Skip to content

Commit a9f67a6

Browse files
committed
memmove -> copyMemory(from:byteCount:)
1 parent 7343a23 commit a9f67a6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Sources/FoundationEssentials/Data/Representations/DataStorage.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ internal final class __DataStorage : @unchecked Sendable {
554554
}
555555
// Make room for the insertion if needed (we don't shrink / shift forward yet to avoid 2 moves if the output span isn't fully filled)
556556
if newByteCount > replacedLength {
557-
memmove(mutableBytes!.advanced(by: trailingLocation), mutableBytes!.advanced(by: subrange.upperBound), trailingLength)
557+
mutableBytes!.advanced(by: trailingLocation).copyMemory(from: mutableBytes!.advanced(by: subrange.upperBound), byteCount: trailingLength)
558558
} else {
559559
trailingLocation = subrange.upperBound
560560
}
@@ -565,7 +565,7 @@ internal final class __DataStorage : @unchecked Sendable {
565565
span = OutputRawSpan()
566566
let trailingDestination = subrange.lowerBound + insertedLength
567567
if trailingLocation != trailingDestination {
568-
memmove(mutableBytes!.advanced(by: trailingDestination), mutableBytes!.advanced(by: trailingLocation), trailingLength)
568+
mutableBytes!.advanced(by: trailingDestination).copyMemory(from: mutableBytes!.advanced(by: trailingLocation), byteCount: trailingLength)
569569
}
570570
let newLength = trailingDestination - _offset + trailingLength
571571
if insertedLength > replacedLength {

0 commit comments

Comments
 (0)