@@ -49,7 +49,6 @@ public struct DispatchData : RandomAccessCollection {
49
49
/// Initialize a `Data` with copied memory content.
50
50
///
51
51
/// - parameter bytes: A pointer to the memory. It will be copied.
52
- /// - parameter count: The number of bytes to copy.
53
52
public init ( bytes buffer: UnsafeBufferPointer < UInt8 > ) {
54
53
let d = dispatch_data_create ( buffer. baseAddress!, buffer. count, nil , _dispatch_data_destructor_default ( ) )
55
54
self . init ( data: d)
@@ -88,7 +87,7 @@ public struct DispatchData : RandomAccessCollection {
88
87
public func enumerateBytes(
89
88
block: @noescape ( _ buffer: UnsafeBufferPointer < UInt8 > , _ byteIndex: Int , _ stop: inout Bool ) -> Void )
90
89
{
91
- _swift_dispatch_data_apply ( __wrapped. __wrapped) { ( data : dispatch_data_t , offset: Int , ptr: UnsafeRawPointer , size: Int ) in
90
+ _swift_dispatch_data_apply ( __wrapped. __wrapped) { ( _ , offset: Int , ptr: UnsafeRawPointer , size: Int ) in
92
91
let bytePtr = ptr. bindMemory ( to: UInt8 . self, capacity: size)
93
92
let bp = UnsafeBufferPointer ( start: bytePtr, count: size)
94
93
var stop = false
@@ -124,7 +123,7 @@ public struct DispatchData : RandomAccessCollection {
124
123
}
125
124
}
126
125
127
- private func _copyBytesHelper( to pointer: UnsafeMutablePointer < UInt8 > , from range: CountableRange < Index > ) {
126
+ private func _copyBytesHelper( to pointer: UnsafeMutableRawPointer , from range: CountableRange < Index > ) {
128
127
var copiedCount = 0
129
128
_ = CDispatch . dispatch_data_apply ( __wrapped. __wrapped) { ( data: dispatch_data_t , offset: Int , ptr: UnsafeRawPointer , size: Int ) in
130
129
let limit = Swift . min ( ( range. endIndex - range. startIndex) - copiedCount, size)
@@ -244,7 +243,7 @@ public struct DispatchData : RandomAccessCollection {
244
243
245
244
public struct DispatchDataIterator : IteratorProtocol , Sequence {
246
245
247
- /// Create an iterator over the given DisaptchData
246
+ /// Create an iterator over the given DispatchData
248
247
public init ( _data: DispatchData ) {
249
248
var ptr : UnsafeRawPointer ?
250
249
self . _count = 0
0 commit comments