mirror of
https://github.com/apple/swift-collections
synced 2026-11-28 05:04:21 +00:00
use the horrible replacement
(cherry picked from commit 3f38800c5abd3fa7decf813e8421b4421ec1dd72)
This commit is contained in:
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(
|
||||
|
||||
Reference in new issue
Block a user