@@ -133,7 +133,7 @@ public struct Data : ReferenceConvertible, CustomStringConvertible, Equatable, H
133
133
///
134
134
/// - parameter buffer: A buffer pointer to copy. The size is calculated from `SourceType` and `buffer.count`.
135
135
public init < SourceType> ( buffer: UnsafeBufferPointer < SourceType > ) {
136
- _wrapped = _SwiftNSData ( immutableObject: NSData ( bytes: buffer. baseAddress, length: strideof ( SourceType) * buffer. count) )
136
+ _wrapped = _SwiftNSData ( immutableObject: NSData ( bytes: buffer. baseAddress, length: strideof ( SourceType . self ) * buffer. count) )
137
137
}
138
138
139
139
/// Initialize a `Data` with the contents of an Array.
@@ -319,9 +319,9 @@ public struct Data : ReferenceConvertible, CustomStringConvertible, Equatable, H
319
319
precondition ( r. upperBound >= 0 )
320
320
precondition ( r. upperBound <= cnt, " The range is outside the bounds of the data " )
321
321
322
- copyRange = r. lowerBound..< ( r. lowerBound + Swift. min ( buffer. count * strideof( DestinationType) , r. count) )
322
+ copyRange = r. lowerBound..< ( r. lowerBound + Swift. min ( buffer. count * strideof( DestinationType . self ) , r. count) )
323
323
} else {
324
- copyRange = 0 ..< Swift . min ( buffer. count * strideof( DestinationType) , cnt)
324
+ copyRange = 0 ..< Swift . min ( buffer. count * strideof( DestinationType . self ) , cnt)
325
325
}
326
326
327
327
guard !copyRange. isEmpty else { return 0 }
@@ -408,7 +408,7 @@ public struct Data : ReferenceConvertible, CustomStringConvertible, Equatable, H
408
408
/// - parameter buffer: The buffer of bytes to append. The size is calculated from `SourceType` and `buffer.count`.
409
409
public mutating func append< SourceType> ( _ buffer : UnsafeBufferPointer < SourceType > ) {
410
410
_applyUnmanagedMutation {
411
- $0. append ( buffer. baseAddress!, length: buffer. count * strideof( SourceType) )
411
+ $0. append ( buffer. baseAddress!, length: buffer. count * strideof( SourceType . self ) )
412
412
}
413
413
}
414
414
0 commit comments