File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ public struct DispatchData : RandomAccessCollection {
118118 ///
119119 /// - parameter buffer: The buffer of bytes to append. The size is calculated from `SourceType` and `buffer.count`.
120120 public mutating func append< SourceType> ( _ buffer : UnsafeBufferPointer < SourceType > ) {
121- self . append ( UnsafePointer ( buffer. baseAddress!) , count: buffer. count * MemoryLayout< SourceType> . size )
121+ self . append ( UnsafePointer ( buffer. baseAddress!) , count: buffer. count * MemoryLayout< SourceType> . stride )
122122 }
123123
124124 private func _copyBytesHelper( to pointer: UnsafeMutablePointer < UInt8 > , from range: CountableRange < Index > ) {
@@ -169,9 +169,9 @@ public struct DispatchData : RandomAccessCollection {
169169 precondition ( r. endIndex >= 0 )
170170 precondition ( r. endIndex <= cnt, " The range is outside the bounds of the data " )
171171
172- copyRange = r. startIndex..< ( r. startIndex + Swift. min ( buffer. count * MemoryLayout< DestinationType> . size , r. count) )
172+ copyRange = r. startIndex..< ( r. startIndex + Swift. min ( buffer. count * MemoryLayout< DestinationType> . stride , r. count) )
173173 } else {
174- copyRange = 0 ..< Swift . min ( buffer. count * MemoryLayout< DestinationType> . size , cnt)
174+ copyRange = 0 ..< Swift . min ( buffer. count * MemoryLayout< DestinationType> . stride , cnt)
175175 }
176176
177177 guard !copyRange. isEmpty else { return 0 }
You can’t perform that action at this time.
0 commit comments