Skip to content

Commit bbf8e88

Browse files
committed
Add the Array<UInt8> specialization back for append to Data
1 parent 3c60e01 commit bbf8e88

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

stdlib/public/SDK/Foundation/Data.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,6 +1474,12 @@ public struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessColl
14741474
_append(buffer)
14751475
}
14761476

1477+
public mutating func append(contentsOf bytes: [UInt8]) {
1478+
bytes.withUnsafeBufferPointer { (buffer: UnsafeBufferPointer<UInt8>) -> Void in
1479+
_append(buffer)
1480+
}
1481+
}
1482+
14771483
@inlinable
14781484
public mutating func append<S : Sequence>(contentsOf newElements: S) where S.Iterator.Element == Iterator.Element {
14791485
let underestimatedCount = Swift.max(newElements.underestimatedCount, 1)

0 commit comments

Comments
 (0)