File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -1018,7 +1018,7 @@ extension Unsafe${Mutable}BufferPointer {
10181018 @inlinable
10191019 @_alwaysEmitIntoClient
10201020 public func initializeElement( at index: Index, to value: Element) {
1021- precondition ( startIndex <= index && index < endIndex)
1021+ _debugPrecondition ( startIndex <= index && index < endIndex)
10221022 let p = baseAddress. _unsafelyUnwrappedUnchecked. advanced ( by: index)
10231023 p. initialize ( to: value)
10241024 }
@@ -1036,7 +1036,7 @@ extension Unsafe${Mutable}BufferPointer {
10361036 @inlinable
10371037 @_alwaysEmitIntoClient
10381038 public func moveElement( from index: Index) - > Element {
1039- precondition ( startIndex <= index && index < endIndex)
1039+ _debugPrecondition ( startIndex <= index && index < endIndex)
10401040 return baseAddress. _unsafelyUnwrappedUnchecked. advanced ( by: index) . move ( )
10411041 }
10421042
@@ -1051,7 +1051,7 @@ extension Unsafe${Mutable}BufferPointer {
10511051 @inlinable
10521052 @_alwaysEmitIntoClient
10531053 public func deinitializeElement( at index: Index) {
1054- precondition ( startIndex <= index && index < endIndex)
1054+ _debugPrecondition ( startIndex <= index && index < endIndex)
10551055 let p = baseAddress. _unsafelyUnwrappedUnchecked. advanced ( by: index)
10561056 p. deinitialize ( count: 1 )
10571057 }
Original file line number Diff line number Diff line change @@ -1118,10 +1118,9 @@ extension Slice {
11181118 var slice = UnsafeMutableBufferPointer ( start: start, count: count)
11191119 let ( b, c) = ( slice. baseAddress, slice. count)
11201120 defer {
1121- precondition (
1121+ _precondition (
11221122 slice. baseAddress == b && slice. count == c,
1123- " Slice.withContiguousMutableStorageIfAvailable: " +
1124- " replacing the buffer is not allowed " )
1123+ " withContiguousMutableStorageIfAvailable: replacing the buffer is not allowed " )
11251124 }
11261125 return try body ( & slice)
11271126 }
You can’t perform that action at this time.
0 commit comments