mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user