Skip to content

Commit c1ab18e

Browse files
committed
[gardening] add .self to recent changes for struct Data
1 parent 8df507a commit c1ab18e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/public/SDK/Foundation/Data.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public struct Data : ReferenceConvertible, CustomStringConvertible, Equatable, H
140140
///
141141
/// - parameter buffer: A buffer pointer to copy. The size is calculated from `SourceType` and `buffer.count`.
142142
public init<SourceType>(buffer: UnsafeMutableBufferPointer<SourceType>) {
143-
_wrapped = _SwiftNSData(immutableObject: NSData(bytes: UnsafePointer(buffer.baseAddress), length: strideof(SourceType) * buffer.count))
143+
_wrapped = _SwiftNSData(immutableObject: NSData(bytes: UnsafePointer(buffer.baseAddress), length: strideof(SourceType.self) * buffer.count))
144144
}
145145

146146
/// Initialize a `Data` with the contents of an Array.
@@ -482,7 +482,7 @@ public struct Data : ReferenceConvertible, CustomStringConvertible, Equatable, H
482482
/// - parameter buffer: The replacement bytes.
483483
public mutating func replaceBytes<SourceType>(in range: Range<Index>, with buffer: UnsafeBufferPointer<SourceType>) {
484484
let nsRange = NSMakeRange(range.lowerBound, range.upperBound - range.lowerBound)
485-
let bufferCount = buffer.count * strideof(SourceType)
485+
let bufferCount = buffer.count * strideof(SourceType.self)
486486

487487
_applyUnmanagedMutation {
488488
$0.replaceBytes(in: nsRange, withBytes: buffer.baseAddress, length: bufferCount)

0 commit comments

Comments
 (0)