mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[stdlib] indexing model: Interval/Range merge
This is step 1; we still need to introduce ClosedRange.
This commit is contained in:
@@ -32,8 +32,8 @@ func _toNSArray<T, U : AnyObject>(a: [T], @noescape f: (T) -> U) -> NSArray {
|
||||
@warn_unused_result
|
||||
func _toNSRange(r: Range<String.Index>) -> NSRange {
|
||||
return NSRange(
|
||||
location: r.startIndex._utf16Index,
|
||||
length: r.endIndex._utf16Index - r.startIndex._utf16Index)
|
||||
location: r.lowerBound._utf16Index,
|
||||
length: r.upperBound._utf16Index - r.lowerBound._utf16Index)
|
||||
}
|
||||
|
||||
@warn_unused_result
|
||||
|
||||
Reference in New Issue
Block a user