mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] Index interchange, part I
This commit is contained in:
@@ -151,8 +151,8 @@ extension NSRange {
|
||||
where R.Bound == S.Index, S.Index == String.Index {
|
||||
let r = region.relative(to: target)
|
||||
self = NSRange(
|
||||
location: r.lowerBound._utf16Index - target.startIndex._utf16Index,
|
||||
length: r.upperBound._utf16Index - r.lowerBound._utf16Index
|
||||
location: r.lowerBound.encodedOffset - target.startIndex.encodedOffset,
|
||||
length: r.upperBound.encodedOffset - r.lowerBound.encodedOffset
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user