Rename UnsafePointer assign/initialize and eliminate Backward variants. (#3585)

Also fixes the comments to clarify that source and self memory
must be disjoint.
This commit is contained in:
Andrew Trick
2016-07-18 15:15:47 -07:00
committed by GitHub
parent 18fb99ad71
commit 0230efc614
13 changed files with 163 additions and 203 deletions

View File

@@ -1333,7 +1333,7 @@ extension ${Self} : RangeReplaceableCollection, _ArrayProtocol {
Swift.max(newCount, _growArrayCapacity(capacity))
: newCount)
(self._buffer.firstElementAddress + oldCount).initializeFrom(newElements)
(self._buffer.firstElementAddress + oldCount).initialize(from: newElements)
self._buffer.count = newCount
}
@@ -1888,7 +1888,7 @@ internal func _arrayOutOfPlaceUpdate<_Buffer, Initializer>(
backingStart.deinitialize(count: sourceOffset)
// Move the head items
destStart.moveInitializeFrom(sourceStart, count: headCount)
destStart.moveInitialize(from: sourceStart, count: headCount)
// Destroy unused source items
oldStart.deinitialize(count: oldCount)
@@ -1896,7 +1896,7 @@ internal func _arrayOutOfPlaceUpdate<_Buffer, Initializer>(
initializeNewElements.call(newStart, count: newCount)
// Move the tail items
newEnd.moveInitializeFrom(oldStart + oldCount, count: tailCount)
newEnd.moveInitialize(from: oldStart + oldCount, count: tailCount)
// Destroy any items that may be lurking in a _SliceBuffer after
// its real last element