We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c025baa + 6217b0f commit a618b46Copy full SHA for a618b46
src/swift/Data.swift
@@ -168,10 +168,7 @@ public struct DispatchData : RandomAccessCollection {
168
///
169
/// - parameter buffer: The buffer of bytes to append. The size is calculated from `SourceType` and `buffer.count`.
170
public mutating func append<SourceType>(_ buffer : UnsafeBufferPointer<SourceType>) {
171
- let count = buffer.count * MemoryLayout<SourceType>.stride;
172
- buffer.baseAddress?.withMemoryRebound(to: UInt8.self, capacity: count) {
173
- self.append($0, count: count)
174
- }
+ self.append(UnsafeRawBufferPointer(buffer))
175
}
176
177
private func _copyBytesHelper(to pointer: UnsafeMutableRawPointer, from range: Range<Index>) {
0 commit comments