Skip to content

Commit 7c0910a

Browse files
committed
Address review feedback
1 parent b9e622b commit 7c0910a

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

stdlib/public/SDK/Foundation/Data.swift

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,6 @@ public struct Data : ReferenceConvertible, CustomStringConvertible, Equatable, H
129129
_wrapped = _SwiftNSData(immutableObject: NSData(bytes: bytes, length: count))
130130
}
131131

132-
/// Initialize a `Data` with copied memory content.
133-
///
134-
/// - parameter bytes: A pointer to the memory. It will be copied.
135-
/// - parameter count: The number of bytes to copy.
136-
public init(bytes: UnsafeMutablePointer<UInt8>, count: Int) {
137-
_wrapped = _SwiftNSData(immutableObject: NSData(bytes: UnsafePointer(bytes), length: count))
138-
}
139-
140132
/// Initialize a `Data` with copied memory content.
141133
///
142134
/// - parameter buffer: A buffer pointer to copy. The size is calculated from `SourceType` and `buffer.count`.
@@ -260,19 +252,7 @@ public struct Data : ReferenceConvertible, CustomStringConvertible, Equatable, H
260252
public init(reference: NSData) {
261253
_wrapped = _SwiftNSData(immutableObject: reference.copy())
262254
}
263-
264-
/// Initialize a `Data` by adopting a mutable reference type.
265-
///
266-
/// You can use this initializer to create a `struct Data` that wraps a `class NSMutableData`. `struct Data` will use the `class NSMutableData` for all operations. Other initializers (including casting using `as Data`) may choose to hold a reference or not, based on a what is the most efficient representation.
267-
///
268-
/// If the resulting value is mutated, then `Data` will invoke the `mutableCopy()` function on the reference to copy the contents. You may customize the behavior of that function if you wish to return a specialized mutable subclass.
269-
///
270-
/// - warning: For performance reasons, this method does not copy the reference on initialization. It assumes that the reference is uniquely held by the struct. If you continue to mutate the reference after invoking this initializer, you may invalidate the copy-on-write and value semantics of `struct Data`. It is recommended that you do not keep the reference after initializing a `Data` with it.
271-
/// - parameter mutableReference: The instance of `NSMutableData` that you wish to wrap.
272-
public init(mutableReference: NSMutableData) {
273-
_wrapped = _SwiftNSData(mutableObject: mutableReference)
274-
}
275-
255+
276256
// -----------------------------------
277257
// MARK: - Properties and Functions
278258

0 commit comments

Comments
 (0)