Skip to content

Commit f493b54

Browse files
author
Dave Abrahams
committedMar 16, 2016
[stdlib] indexing model: Interval/Range merge
This is step 1; we still need to introduce ClosedRange.
1 parent 8c5cf9b commit f493b54

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+428
-630
lines changed
 

‎benchmark/single-source/PopFrontGeneric.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ func _arrayReplace<B: _ArrayBufferProtocol, C: Collection
2424
target: inout B, _ subRange: Range<Int>, _ newValues: C
2525
) {
2626
_precondition(
27-
subRange.startIndex >= 0,
27+
subRange.lowerBound >= 0,
2828
"Array replace: subRange start is negative")
2929

3030
_precondition(
31-
subRange.endIndex <= target.endIndex,
31+
subRange.upperBound <= target.endIndex,
3232
"Array replace: subRange extends past the end")
3333

3434
let oldCount = target.count

‎stdlib/private/StdlibCollectionUnittest/CheckCollectionType.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ public struct SubscriptRangeTest {
2323

2424
public func boundsIn<C : Collection>(c: C) -> Range<C.Index> {
2525
let i = c.startIndex
26-
return c.advance(i, by: numericCast(bounds.startIndex)) ..<
27-
c.advance(i, by: numericCast(bounds.endIndex))
26+
return c.advance(i, by: numericCast(bounds.lowerBound)) ..<
27+
c.advance(i, by: numericCast(bounds.upperBound))
2828
}
2929

3030
public init(

0 commit comments

Comments
 (0)