File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -117,8 +117,22 @@ public struct DispatchData : RandomAccessCollection {
117117 return try body ( contentPtr)
118118 }
119119
120+ @available ( swift 4 . 2 )
121+ public func enumerateBytes(
122+ _ block: ( _ buffer: UnsafeBufferPointer < UInt8 > , _ byteIndex: Int , _ stop: inout Bool ) -> Void )
123+ {
124+ enumerateBytesCommon ( block)
125+ }
126+
127+ @available ( swift, obsoleted: 4.2 , renamed: " enumerateBytes(_:) " )
120128 public func enumerateBytes(
121129 block: ( _ buffer: UnsafeBufferPointer < UInt8 > , _ byteIndex: Int , _ stop: inout Bool ) -> Void )
130+ {
131+ enumerateBytesCommon ( block)
132+ }
133+
134+ private func enumerateBytesCommon(
135+ _ block: ( _ buffer: UnsafeBufferPointer < UInt8 > , _ byteIndex: Int , _ stop: inout Bool ) -> Void )
122136 {
123137 // we know that capturing block in the closure being created/passed to dispatch_data_apply
124138 // does not cause block to escape because dispatch_data_apply does not allow its
You can’t perform that action at this time.
0 commit comments