File tree 1 file changed +3
-3
lines changed
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 {
118
118
///
119
119
/// - parameter buffer: The buffer of bytes to append. The size is calculated from `SourceType` and `buffer.count`.
120
120
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 )
122
122
}
123
123
124
124
private func _copyBytesHelper( to pointer: UnsafeMutablePointer < UInt8 > , from range: CountableRange < Index > ) {
@@ -169,9 +169,9 @@ public struct DispatchData : RandomAccessCollection {
169
169
precondition ( r. endIndex >= 0 )
170
170
precondition ( r. endIndex <= cnt, " The range is outside the bounds of the data " )
171
171
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) )
173
173
} else {
174
- copyRange = 0 ..< Swift . min ( buffer. count * MemoryLayout< DestinationType> . size , cnt)
174
+ copyRange = 0 ..< Swift . min ( buffer. count * MemoryLayout< DestinationType> . stride , cnt)
175
175
}
176
176
177
177
guard !copyRange. isEmpty else { return 0 }
You can’t perform that action at this time.
0 commit comments