Skip to content

Commit 0bdc84b

Browse files
authored
Merge pull request #62859 from lorentey/mark-utf8-index-encoding
[stdlib] String.UTF8View.index(_:offsetBy:limitedBy:): mark encoding of result
2 parents 6b33768 + 892d0a2 commit 0bdc84b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/public/core/StringUTF8View.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ extension String.UTF8View: BidirectionalCollection {
191191
}
192192
_precondition(result >= 0 && result <= _guts.count,
193193
"String index is out of bounds")
194-
return Index(_encodedOffset: result)
194+
return Index(_encodedOffset: result)._knownUTF8
195195
}
196196

197197
return _foreignIndex(i, offsetBy: n, limitedBy: limit)

0 commit comments

Comments
 (0)