diff --git a/stdlib/public/core/ArrayBufferType.swift b/stdlib/public/core/ArrayBufferType.swift index 560ae923181..40fa99e32a1 100644 --- a/stdlib/public/core/ArrayBufferType.swift +++ b/stdlib/public/core/ArrayBufferType.swift @@ -160,12 +160,12 @@ extension _ArrayBufferType { var i = newValues.startIndex for j in subRange { elements[j] = newValues[i] - i = i.successor() + i._successorInPlace() } // Initialize the hole left by sliding the tail forward for j in oldTailIndex.. T? in if _fastPath(index != self.endIndex) { - index = index.successor() + index._successorInPlace() return self._subscriptImpl(index) } return nil diff --git a/stdlib/public/core/HashedCollections.swift.gyb b/stdlib/public/core/HashedCollections.swift.gyb index cffd0c65a97..098c08fd1b6 100644 --- a/stdlib/public/core/HashedCollections.swift.gyb +++ b/stdlib/public/core/HashedCollections.swift.gyb @@ -1231,7 +1231,7 @@ public func == ( let endIndex = lhsNative.endIndex for var index = lhsNative.startIndex; index != endIndex; - index = index.successor() { + index._successorInPlace() { let (key, value) = lhsNative.assertingGet(index) let optRhsValue: AnyObject? = rhsCocoa.maybeGet(_bridgeToObjectiveCUnconditional(key)) @@ -2390,7 +2390,7 @@ final internal class _Native${Self}StorageKeyNSEnumerator< return nil } let bridgedKey: AnyObject = nativeStorageOwner._getBridgedKey(nextIndex) - nextIndex = nextIndex.successor() + nextIndex._successorInPlace() return bridgedKey } @@ -2415,7 +2415,7 @@ final internal class _Native${Self}StorageKeyNSEnumerator< // Return only a single element so that code can start iterating via fast // enumeration, terminate it, and continue via NSEnumerator. let bridgedKey: AnyObject = nativeStorageOwner._getBridgedKey(nextIndex) - nextIndex = nextIndex.successor() + nextIndex._successorInPlace() let unmanagedObjects = _UnmanagedAnyObjectArray(objects) unmanagedObjects[0] = bridgedKey @@ -2767,7 +2767,7 @@ final internal class _Native${Self}StorageOwner<${TypeParametersDecl}> let bridgedKey: AnyObject = _getBridgedKey(currIndex) unmanagedObjects[i] = bridgedKey ++stored - currIndex = currIndex.successor() + currIndex._successorInPlace() } theState.extra.0 = CUnsignedLong(currIndex.offset) state.memory = theState @@ -3970,7 +3970,7 @@ internal struct ${Self}MirrorPosition<${TypeParametersDecl}> { internal mutating func successor() { _intPos = _intPos + 1 - ${Self}Pos = ${Self}Pos.successor() + ${Self}Pos._successorInPlace() } } diff --git a/stdlib/public/core/Index.swift b/stdlib/public/core/Index.swift index 708cc390f6d..526d91a78ee 100644 --- a/stdlib/public/core/Index.swift +++ b/stdlib/public/core/Index.swift @@ -216,7 +216,7 @@ extension ForwardIndexType { var p = self var i : Distance = 0 while i != n { - p = p.successor() + p._successorInPlace() i = i + 1 } return p @@ -232,7 +232,7 @@ extension ForwardIndexType { var i : Distance = 0 while i != n { if p == limit { break } - p = p.successor() + p._successorInPlace() i = i + 1 } return p @@ -254,7 +254,7 @@ extension ForwardIndexType { var count: Distance = 0 while p != end { count += 1 - p = p.successor() + p._successorInPlace() } return count } diff --git a/stdlib/public/core/Sort.swift.gyb b/stdlib/public/core/Sort.swift.gyb index 7288fdc9e87..67a7e7ed5c9 100644 --- a/stdlib/public/core/Sort.swift.gyb +++ b/stdlib/public/core/Sort.swift.gyb @@ -56,7 +56,7 @@ func _insertionSort< // One element is trivially already-sorted, thus pre-increment // Continue until the sorted elements cover the whole sequence - sortedEnd = sortedEnd.successor() + sortedEnd._successorInPlace() while sortedEnd != range.endIndex { // get the first unsorted element let x: C.Generator.Element = elements[sortedEnd] @@ -81,7 +81,7 @@ func _insertionSort< // Plop x into position elements[i] = x } - sortedEnd = sortedEnd.successor() + sortedEnd._successorInPlace() } } } diff --git a/stdlib/public/core/StringCharacterView.swift b/stdlib/public/core/StringCharacterView.swift index 57a0f3c4b32..a6d3e40d5c4 100644 --- a/stdlib/public/core/StringCharacterView.swift +++ b/stdlib/public/core/StringCharacterView.swift @@ -143,9 +143,9 @@ extension String.CharacterView : CollectionType { var gcb0 = graphemeClusterBreakProperty.getPropertyRawValue( unicodeScalars[start].value) - start = start.successor() + start._successorInPlace() - for ; start != end; start = start.successor() { + for ; start != end; start._successorInPlace() { // FIXME(performance): consider removing this "fast path". A branch // that is hard to predict could be worse for performance than a few // loads from cache to fetch the property 'gcb1'. diff --git a/stdlib/public/core/StringLegacy.swift b/stdlib/public/core/StringLegacy.swift index 55c5862ba87..7f2b9e0359d 100644 --- a/stdlib/public/core/StringLegacy.swift +++ b/stdlib/public/core/StringLegacy.swift @@ -158,7 +158,7 @@ extension String { let rng = unicodeScalars var startIndex = rng.startIndex for _ in 0..