File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -165,12 +165,16 @@ public struct Unsafe${Mutable}BufferPointer<Element>
165
165
166
166
@_inlineable
167
167
public func _failEarlyRangeCheck( _ index: Int , bounds: Range < Int > ) {
168
- // NOTE: This method is a no-op for performance reasons.
168
+ // NOTE: In release mode, this method is a no-op for performance reasons.
169
+ _debugPrecondition ( index >= bounds. lowerBound)
170
+ _debugPrecondition ( index < bounds. upperBound)
169
171
}
170
172
171
173
@_inlineable
172
174
public func _failEarlyRangeCheck( _ range: Range < Int > , bounds: Range < Int > ) {
173
- // NOTE: This method is a no-op for performance reasons.
175
+ // NOTE: In release mode, this method is a no-op for performance reasons.
176
+ _debugPrecondition ( range. lowerBound >= bounds. lowerBound)
177
+ _debugPrecondition ( range. upperBound <= bounds. upperBound)
174
178
}
175
179
176
180
public typealias Indices = CountableRange < Int >
You can’t perform that action at this time.
0 commit comments