mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #62859 from lorentey/mark-utf8-index-encoding
[stdlib] String.UTF8View.index(_:offsetBy:limitedBy:): mark encoding of result
This commit is contained in:
@@ -191,7 +191,7 @@ extension String.UTF8View: BidirectionalCollection {
|
||||
}
|
||||
_precondition(result >= 0 && result <= _guts.count,
|
||||
"String index is out of bounds")
|
||||
return Index(_encodedOffset: result)
|
||||
return Index(_encodedOffset: result)._knownUTF8
|
||||
}
|
||||
|
||||
return _foreignIndex(i, offsetBy: n, limitedBy: limit)
|
||||
|
||||
Reference in New Issue
Block a user