[stdlib] indexing model: Interval/Range merge

This is step 1; we still need to introduce ClosedRange.
This commit is contained in:
Dave Abrahams
2016-03-16 15:57:35 -07:00
parent 8c5cf9b4fc
commit f493b54e44
49 changed files with 431 additions and 633 deletions

View File

@@ -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