File tree Expand file tree Collapse file tree 2 files changed +3
-12
lines changed Expand file tree Collapse file tree 2 files changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -290,18 +290,12 @@ extension MutableSpan where Element: ~Copyable {
290290 @_alwaysEmitIntoClient
291291 public subscript( _ position: Index ) -> Element {
292292 unsafeAddress {
293- _precondition (
294- UInt ( bitPattern: position) < UInt ( bitPattern: _count) ,
295- " Index out of bounds "
296- )
293+ _precondition ( indices. contains ( position) , " index out of bounds " )
297294 return unsafe UnsafePointer( _unsafeAddressOfElement ( unchecked: position) )
298295 }
299296 @lifetime ( self : copy self )
300297 unsafeMutableAddress {
301- _precondition (
302- UInt ( bitPattern: position) < UInt ( bitPattern: _count) ,
303- " Index out of bounds "
304- )
298+ _precondition ( indices. contains ( position) , " index out of bounds " )
305299 return unsafe _unsafeAddressOfElement( unchecked: position)
306300 }
307301 }
Original file line number Diff line number Diff line change @@ -419,10 +419,7 @@ extension Span where Element: ~Copyable {
419419 @inline ( __always)
420420 @_alwaysEmitIntoClient
421421 internal func _checkIndex( _ position: Index ) {
422- _precondition (
423- UInt ( bitPattern: position) < UInt ( bitPattern: _count) ,
424- " Index out of bounds "
425- )
422+ _precondition ( indices. contains ( position) , " Index out of bounds " )
426423 }
427424
428425 /// Accesses the element at the specified position in the `Span`.
You can’t perform that action at this time.
0 commit comments