use the horrible replacement

(cherry picked from commit 3f38800c5abd3fa7decf813e8421b4421ec1dd72)
This commit is contained in:
Guillaume Lessard authored and Karoy Lorentey committed 2026-01-29 11:26:31 -08:00
1 parent 942cfbfd68
commit bcbee23816
2 files changed
+3 -3

No files matched your search

@@ -303,7 +303,7 @@ extension RigidArray {
) {
guard newElements.count > 0 else { return }
self.insert(count: newElements.count, at: index) { target in
target.withUnsafeMutableBufferPointer { buffer, count in
target._withUnsafeMutableBufferPointer { buffer, count in
buffer.initializeAll(fromContentsOf: newElements)
count = newElements.count
}
@@ -303,7 +303,7 @@ extension RigidArray {
copying newElements: UnsafeBufferPointer<Element>
) {
replaceSubrange(subrange, newCount: newElements.count) { target in
target.withUnsafeMutableBufferPointer { buffer, count in
target._withUnsafeMutableBufferPointer { buffer, count in
count = unsafe buffer._initializePrefix(copying: newElements)
}
}
@@ -410,7 +410,7 @@ extension RigidArray {
newCount: Int
) {
self.replaceSubrange(subrange, newCount: newCount) { target in
target.withUnsafeMutableBufferPointer { dst, dstCount in
target._withUnsafeMutableBufferPointer { dst, dstCount in
let done: Void? = newElements.withContiguousStorageIfAvailable { src in
let i = unsafe dst._initializePrefix(copying: src)
precondition(