@@ -71,13 +71,13 @@ public func check${inc.capitalize()}rementable<
71
71
checkEquatable ( instances, oracle: equalityOracle, ${ trace} )
72
72
for i in instances {
73
73
if i != ${ end} Index {
74
- let next = baseCollection. location ( ${ direction} : i)
75
- // location (${direction}:) gets us a new index value
74
+ let next = baseCollection. index ( ${ direction} : i)
75
+ // index (${direction}:) gets us a new index value
76
76
expectNotEqual ( i, next, ${ trace} )
77
77
78
- // Which is the same as if we apply formLocation (${direction}:)
78
+ // Which is the same as if we apply formIndex (${direction}:)
79
79
var j = i
80
- baseCollection. formLocation ( ${ direction} : & j)
80
+ baseCollection. formIndex ( ${ direction} : & j)
81
81
expectEqual ( j, next, ${ trace} )
82
82
}
83
83
}
@@ -108,8 +108,8 @@ internal func _checkIncrementalAdvance<
108
108
109
109
var offset : BaseCollection . IndexDistance = 0
110
110
for _ in 0 ... ( d * sign) . toIntMax ( ) {
111
- let j = baseCollection. location ( i, offsetBy: offset)
112
- let k = baseCollection. location ( i, offsetBy: offset + sign, limitedBy: limit) ?? limit
111
+ let j = baseCollection. index ( i, offsetBy: offset)
112
+ let k = baseCollection. index ( i, offsetBy: offset + sign, limitedBy: limit) ?? limit
113
113
let jAtLimit = offset == d
114
114
if jAtLimit {
115
115
expectEqual ( limit, j, ${ trace} )
@@ -145,7 +145,7 @@ public func checkForwardIndex<
145
145
146
146
_checkIncrementalAdvance ( instances, of: baseCollection,
147
147
equalityOracle: equalityOracle, limit: endIndex,
148
- sign: 1 , next: { baseCollection. location ( after: $0) } , ${ trace} )
148
+ sign: 1 , next: { baseCollection. index ( after: $0) } , ${ trace} )
149
149
}
150
150
151
151
/// Test that the elements of `instances` satisfy the semantic requirements of
@@ -179,7 +179,7 @@ public func checkBidirectionalIndex<
179
179
180
180
_checkIncrementalAdvance ( instances, of: baseCollection,
181
181
equalityOracle: equalityOracle, limit: startIndex,
182
- sign: - 1 , next: { baseCollection. location ( before: $0) } , ${ trace} )
182
+ sign: - 1 , next: { baseCollection. index ( before: $0) } , ${ trace} )
183
183
}
184
184
185
185
/// Test that the elements of `instances` satisfy the semantic requirements of
@@ -257,11 +257,11 @@ public func checkAdvancesAndDistances<
257
257
258
258
for i in instances. indices {
259
259
let x = instances [ i]
260
- expectEqual ( x, baseCollection. location ( x, offsetBy: 0 ) )
260
+ expectEqual ( x, baseCollection. index ( x, offsetBy: 0 ) )
261
261
262
262
for j in distances. indices {
263
263
let y = distances [ j]
264
- expectEqual ( advanceOracle ( i, j) , baseCollection. location ( x, offsetBy: y) )
264
+ expectEqual ( advanceOracle ( i, j) , baseCollection. index ( x, offsetBy: y) )
265
265
}
266
266
267
267
for j in instances. indices {
@@ -299,9 +299,9 @@ public func check${Traversal}Collection<
299
299
resiliencyChecks: resiliencyChecks, sameValue: sameValue)
300
300
}
301
301
302
- let succ = { collection. location ( after: $0) }
302
+ let succ = { collection. index ( after: $0) }
303
303
% if Traversal != 'Forward':
304
- let pred = { collection. location ( before: $0) }
304
+ let pred = { collection. index ( before: $0) }
305
305
% end
306
306
// Advances up to 1 positions without passing endIndex. Don't use
307
307
// advanced(by: n) to do this because it's under test here.
@@ -347,7 +347,7 @@ public func check${Traversal}Collection<
347
347
}
348
348
349
349
func nextN( _ n: Distance, _ i: C . Index) - > C. Index {
350
- return collection. location ( i, offsetBy: n)
350
+ return collection. index ( i, offsetBy: n)
351
351
}
352
352
353
353
let instances = _allIndices ( into: collection, in: partWay0..< partWay1)
@@ -489,8 +489,8 @@ public func checkSliceableWithBidirectionalIndex<
489
489
490
490
let expectedArray = Array ( expected)
491
491
492
- let succ = { sliceable. location ( after: $0) }
493
- let pred = { sliceable. location ( before: $0) }
492
+ let succ = { sliceable. index ( after: $0) }
493
+ let pred = { sliceable. index ( before: $0) }
494
494
495
495
var start = sliceable. startIndex
496
496
for startNumericIndex in 0 ... expectedArray. count {
0 commit comments