mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
implement SE 184: add allocation methods to Unsafe buffer pointers, drop all parameters from deallocation, adjust namings, and add repeated-value assignment methods
This commit is contained in:
committed by
Andrew Trick
parent
c7d33e70d3
commit
c85880899d
@@ -718,8 +718,8 @@ extension _StringCore : RangeReplaceableCollection {
|
||||
let tailStart = rangeStart + (replacedCount &<< elementShift)
|
||||
|
||||
if growth > 0 {
|
||||
(tailStart + (growth &<< elementShift)).copyBytes(
|
||||
from: tailStart, count: tailCount &<< elementShift)
|
||||
(tailStart + (growth &<< elementShift)).copyMemory(
|
||||
from: tailStart, byteCount: tailCount &<< elementShift)
|
||||
}
|
||||
|
||||
if _fastPath(elementWidth == 1) {
|
||||
@@ -738,8 +738,8 @@ extension _StringCore : RangeReplaceableCollection {
|
||||
}
|
||||
|
||||
if growth < 0 {
|
||||
(tailStart + (growth &<< elementShift)).copyBytes(
|
||||
from: tailStart, count: tailCount &<< elementShift)
|
||||
(tailStart + (growth &<< elementShift)).copyMemory(
|
||||
from: tailStart, byteCount: tailCount &<< elementShift)
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user