We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5358c4a commit 984da68Copy full SHA for 984da68
stdlib/public/core/StringBridge.swift
@@ -807,7 +807,7 @@ extension StringProtocol {
807
public // SPI(Foundation)
808
func _toUTF16Indices(_ range: Range<Int>) -> Range<Index> {
809
let lowerbound = _toUTF16Index(range.lowerBound)
810
- let upperbound = _toUTF16Index(range.lowerBound + range.count)
+ let upperbound = self.utf16.index(lowerbound, offsetBy: range.count)
811
return Range(uncheckedBounds: (lower: lowerbound, upper: upperbound))
812
}
813
0 commit comments