Apply review suggestions

This commit is contained in:
Alejandro Alonso committed 2026-08-12 13:29:24 -07:00
1 parent f2914d4fb4
commit 4fd692f00b
2 files changed
+17 -25

No files matched your search

@@ -129,7 +129,11 @@ extension UniqueArray where Element: ~Copyable {
moving items: inout OutputSpan<Element>
) {
_ensureFreeCapacity(items.count)
unsafe _storage._appendUnchecked(moving: &items)
items.withUnsafeMutableBufferPointer { buffer, count in
let source = buffer._extracting(first: count)
unsafe _appendUnchecked(moving: source)
count = 0
}
}
#if !UnstableContainersPreview
@@ -254,7 +258,9 @@ extension UniqueArray {
@_alwaysEmitIntoClient
public mutating func append(copying newElements: Span<Element>) {
_ensureFreeCapacity(newElements.count)
unsafe _storage._appendUnchecked(copying: newElements)
items.withUnsafeBufferPointer { source in
unsafe _storage._appendUnchecked(copying: source)
}
}
#if compiler(>=6.4) && UnstableContainersPreview