@@ -141,7 +141,7 @@ public struct Data : ReferenceConvertible, CustomStringConvertible, Equatable, H
141
141
///
142
142
/// - parameter buffer: A buffer pointer to copy. The size is calculated from `SourceType` and `buffer.count`.
143
143
public init < SourceType> ( buffer: UnsafeBufferPointer < SourceType > ) {
144
- _wrapped = _SwiftNSData ( immutableObject: NSData ( bytes: buffer. baseAddress, length: strideof ( SourceType) * buffer. count) )
144
+ _wrapped = _SwiftNSData ( immutableObject: NSData ( bytes: buffer. baseAddress, length: strideof ( SourceType . self ) * buffer. count) )
145
145
}
146
146
147
147
/// Initialize a `Data` with copied memory content.
@@ -370,9 +370,9 @@ public struct Data : ReferenceConvertible, CustomStringConvertible, Equatable, H
370
370
precondition ( r. upperBound >= 0 )
371
371
precondition ( r. upperBound <= cnt, " The range is outside the bounds of the data " )
372
372
373
- copyRange = r. lowerBound..< ( r. lowerBound + Swift. min ( buffer. count * strideof( DestinationType) , r. count) )
373
+ copyRange = r. lowerBound..< ( r. lowerBound + Swift. min ( buffer. count * strideof( DestinationType . self ) , r. count) )
374
374
} else {
375
- copyRange = 0 ..< Swift . min ( buffer. count * strideof( DestinationType) , cnt)
375
+ copyRange = 0 ..< Swift . min ( buffer. count * strideof( DestinationType . self ) , cnt)
376
376
}
377
377
378
378
guard !copyRange. isEmpty else { return 0 }
@@ -459,7 +459,7 @@ public struct Data : ReferenceConvertible, CustomStringConvertible, Equatable, H
459
459
/// - parameter buffer: The buffer of bytes to append. The size is calculated from `SourceType` and `buffer.count`.
460
460
public mutating func append< SourceType> ( _ buffer : UnsafeBufferPointer < SourceType > ) {
461
461
_applyUnmanagedMutation {
462
- $0. append ( buffer. baseAddress!, length: buffer. count * strideof( SourceType) )
462
+ $0. append ( buffer. baseAddress!, length: buffer. count * strideof( SourceType . self ) )
463
463
}
464
464
}
465
465
0 commit comments