File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ extension LazyChunked: LazyCollectionProtocol {
95
95
96
96
@inlinable
97
97
public func index( after i: Index ) -> Index {
98
+ precondition ( i != endIndex, " Can't advance past endIndex " )
98
99
let upperBound = i. upperBound ?? endOfChunk ( startingAt: i. lowerBound)
99
100
guard upperBound != base. endIndex else { return endIndex }
100
101
let end = endOfChunk ( startingAt: upperBound)
@@ -140,6 +141,7 @@ extension LazyChunked: BidirectionalCollection
140
141
141
142
@inlinable
142
143
public func index( before i: Index ) -> Index {
144
+ precondition ( i != endIndex, " Can't advance before startIndex " )
143
145
let start = startOfChunk ( endingAt: i. lowerBound)
144
146
return Index ( lowerBound: start, upperBound: i. lowerBound)
145
147
}
You can’t perform that action at this time.
0 commit comments