Skip to content

Commit 3f534c2

Browse files
Merge pull request #5485 from airspeedswift/expectEnd-labels-fixme
[stdlib] Add arg labels to _expectEnd (ABI FIXME #15)
2 parents 874eb16 + 8147338 commit 3f534c2

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

Diff for: stdlib/public/core/ArrayBufferProtocol.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ extension _ArrayBufferProtocol where Index == Int {
167167
(elements + j).initialize(to: newValues[i])
168168
newValues.formIndex(after: &i)
169169
}
170-
_expectEnd(i, newValues)
170+
_expectEnd(of: newValues, is: i)
171171
}
172172
else { // We're not growing the buffer
173173
// Assign all the new elements into the start of the subRange
@@ -178,7 +178,7 @@ extension _ArrayBufferProtocol where Index == Int {
178178
formIndex(after: &i)
179179
newValues.formIndex(after: &j)
180180
}
181-
_expectEnd(j, newValues)
181+
_expectEnd(of: newValues, is: j)
182182

183183
// If the size didn't change, we're done.
184184
if growth == 0 {

Diff for: stdlib/public/core/Arrays.swift.gyb

+2-3
Original file line numberDiff line numberDiff line change
@@ -1656,7 +1656,7 @@ internal struct _InitializeMemoryFromCollection<
16561656
newValues.formIndex(after: &q)
16571657
p += 1
16581658
}
1659-
_expectEnd(q, newValues)
1659+
_expectEnd(of: newValues, is: q)
16601660
}
16611661

16621662
init(_ newValues: C) {
@@ -1694,8 +1694,7 @@ internal func _arrayOutOfPlaceReplace<B, C>(
16941694
/// A _debugPrecondition check that `i` has exactly reached the end of
16951695
/// `s`. This test is never used to ensure memory safety; that is
16961696
/// always guaranteed by measuring `s` once and re-using that value.
1697-
// FIXME(ABI)#15 : add argument labels.
1698-
internal func _expectEnd<C : Collection>(_ i: C.Index, _ s: C) {
1697+
internal func _expectEnd<C : Collection>(of s: C, is i: C.Index) {
16991698
_debugPrecondition(
17001699
i == s.endIndex,
17011700
"invalid Collection: count differed in successive traversals")

Diff for: stdlib/public/core/Collection.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1281,7 +1281,7 @@ extension Collection {
12811281
formIndex(after: &i)
12821282
}
12831283

1284-
_expectEnd(i, self)
1284+
_expectEnd(of: self, is: i)
12851285
return Array(result)
12861286
}
12871287

Diff for: stdlib/public/core/ContiguousArrayBuffer.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ internal func _copyCollectionToContiguousArray<
585585
source.formIndex(after: &i)
586586
p += 1
587587
}
588-
_expectEnd(i, source)
588+
_expectEnd(of: source, is: i)
589589
return ContiguousArray(_buffer: result)
590590
}
591591

0 commit comments

Comments
 (0)