File tree Expand file tree Collapse file tree 4 files changed +4
-61
lines changed Expand file tree Collapse file tree 4 files changed +4
-61
lines changed Original file line number Diff line number Diff line change @@ -938,24 +938,6 @@ extension Unsafe${Mutable}BufferPointer {
938
938
p. initialize ( to: value)
939
939
}
940
940
941
- /// Updates the initialized element at `index` to the given value.
942
- ///
943
- /// The memory underlying the destination element must be initialized,
944
- /// or `Element` must be a trivial type. This method is equivalent to:
945
- ///
946
- /// self[index] = value
947
- ///
948
- /// - Parameters:
949
- /// - value: The value used to update the buffer element's memory.
950
- /// - index: The index of the element to update
951
- @inlinable
952
- @_alwaysEmitIntoClient
953
- public func updateElement( at index: Index, to value: Element) {
954
- precondition ( startIndex <= index && index < endIndex)
955
- let p = baseAddress. _unsafelyUnwrappedUnchecked. advanced ( by: index)
956
- p. pointee = value
957
- }
958
-
959
941
/// Retrieves and returns the element at `index`,
960
942
/// leaving that element's underlying memory uninitialized.
961
943
///
Original file line number Diff line number Diff line change @@ -950,24 +950,6 @@ extension Slice {
950
950
base. baseAddress. unsafelyUnwrapped. advanced ( by: index) . initialize ( to: value)
951
951
}
952
952
953
- /// Updates the initialized element at `index` to the given value.
954
- ///
955
- /// The memory underlying the destination element must be initialized,
956
- /// or `Element` must be a trivial type. This method is equivalent to:
957
- ///
958
- /// self[index] = value
959
- ///
960
- /// - Parameters:
961
- /// - value: The value used to update the buffer element's memory.
962
- /// - index: The index of the element to update
963
- @inlinable
964
- @_alwaysEmitIntoClient
965
- public func updateElement< Element> ( at index: Index , to value: Element )
966
- where Base == UnsafeMutableBufferPointer < Element > {
967
- assert ( startIndex <= index && index < endIndex)
968
- base. baseAddress. unsafelyUnwrapped. advanced ( by: index) . pointee = value
969
- }
970
-
971
953
/// Retrieves and returns the element at `index`,
972
954
/// leaving that element's underlying memory uninitialized.
973
955
///
Original file line number Diff line number Diff line change @@ -792,22 +792,6 @@ public struct UnsafeMutablePointer<Pointee>: _Pointer {
792
792
update ( repeating: repeatedValue, count: count)
793
793
}
794
794
795
- /// Update this pointer's initialized memory.
796
- ///
797
- /// The range of memory starting at this pointer and covering one instance
798
- /// of `Pointee` must be initialized, or `Pointee` must be a trivial type.
799
- /// This method is equivalent to:
800
- ///
801
- /// self.pointee = value
802
- ///
803
- /// - Parameters:
804
- /// - value: The value used to update this pointer's memory.
805
- @inlinable
806
- @_alwaysEmitIntoClient
807
- public func update( _ value: Pointee ) {
808
- pointee = value
809
- }
810
-
811
795
/// Update this pointer's initialized memory with the specified number of
812
796
/// instances, copied from the given pointer's memory.
813
797
///
Original file line number Diff line number Diff line change @@ -263,17 +263,12 @@ UnsafeMutableBufferPointerSliceTests.test(
263
263
b [ ... ] . initializeElement ( at: n, to: s)
264
264
expectEqual ( b [ n] , s)
265
265
266
- a. updateElement ( at: n, to: t)
267
- expectEqual ( a [ n] , t)
268
- b [ ... ] . initializeElement ( at: n, to: t)
269
- expectEqual ( b [ n] , t)
266
+ expectEqual ( a. moveElement ( from: n) , s)
267
+ expectEqual ( b [ ... ] . moveElement ( from: n) , s)
270
268
271
- expectEqual ( a. moveElement ( from: n) , t)
272
- expectEqual ( b [ ... ] . moveElement ( from: n) , t)
273
-
274
- a. initializeElement ( at: 0 , to: s)
269
+ a. initializeElement ( at: 0 , to: t)
275
270
a. deinitializeElement ( at: 0 )
276
- b. initializeElement ( at: 0 , to: s )
271
+ b. initializeElement ( at: 0 , to: t )
277
272
b [ ... ] . deinitializeElement ( at: 0 )
278
273
}
279
274
You can’t perform that action at this time.
0 commit comments