From 81473386dfe855bda0b7da852d46eb269d338697 Mon Sep 17 00:00:00 2001 From: Ben Cohen Date: Wed, 26 Oct 2016 12:58:44 -0700 Subject: [PATCH] added arg labels to _expectEnd --- stdlib/public/core/ArrayBufferProtocol.swift | 4 ++-- stdlib/public/core/Arrays.swift.gyb | 5 ++--- stdlib/public/core/Collection.swift | 2 +- stdlib/public/core/ContiguousArrayBuffer.swift | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/stdlib/public/core/ArrayBufferProtocol.swift b/stdlib/public/core/ArrayBufferProtocol.swift index b70f483a73ffc..df69ab6de96dc 100644 --- a/stdlib/public/core/ArrayBufferProtocol.swift +++ b/stdlib/public/core/ArrayBufferProtocol.swift @@ -167,7 +167,7 @@ extension _ArrayBufferProtocol where Index == Int { (elements + j).initialize(to: newValues[i]) newValues.formIndex(after: &i) } - _expectEnd(i, newValues) + _expectEnd(of: newValues, is: i) } else { // We're not growing the buffer // Assign all the new elements into the start of the subRange @@ -178,7 +178,7 @@ extension _ArrayBufferProtocol where Index == Int { formIndex(after: &i) newValues.formIndex(after: &j) } - _expectEnd(j, newValues) + _expectEnd(of: newValues, is: j) // If the size didn't change, we're done. if growth == 0 { diff --git a/stdlib/public/core/Arrays.swift.gyb b/stdlib/public/core/Arrays.swift.gyb index ec66598e01160..090fc79408bd9 100644 --- a/stdlib/public/core/Arrays.swift.gyb +++ b/stdlib/public/core/Arrays.swift.gyb @@ -1656,7 +1656,7 @@ internal struct _InitializeMemoryFromCollection< newValues.formIndex(after: &q) p += 1 } - _expectEnd(q, newValues) + _expectEnd(of: newValues, is: q) } init(_ newValues: C) { @@ -1694,8 +1694,7 @@ internal func _arrayOutOfPlaceReplace( /// A _debugPrecondition check that `i` has exactly reached the end of /// `s`. This test is never used to ensure memory safety; that is /// always guaranteed by measuring `s` once and re-using that value. -// FIXME(ABI)#15 : add argument labels. -internal func _expectEnd(_ i: C.Index, _ s: C) { +internal func _expectEnd(of s: C, is i: C.Index) { _debugPrecondition( i == s.endIndex, "invalid Collection: count differed in successive traversals") diff --git a/stdlib/public/core/Collection.swift b/stdlib/public/core/Collection.swift index 86d3624d8c1a0..6dee7bd1d2e87 100644 --- a/stdlib/public/core/Collection.swift +++ b/stdlib/public/core/Collection.swift @@ -1281,7 +1281,7 @@ extension Collection { formIndex(after: &i) } - _expectEnd(i, self) + _expectEnd(of: self, is: i) return Array(result) } diff --git a/stdlib/public/core/ContiguousArrayBuffer.swift b/stdlib/public/core/ContiguousArrayBuffer.swift index 316775d601d7c..d23564cba7828 100644 --- a/stdlib/public/core/ContiguousArrayBuffer.swift +++ b/stdlib/public/core/ContiguousArrayBuffer.swift @@ -581,7 +581,7 @@ internal func _copyCollectionToContiguousArray< source.formIndex(after: &i) p += 1 } - _expectEnd(i, source) + _expectEnd(of: source, is: i) return ContiguousArray(_buffer: result) }