File tree 6 files changed +433
-445
lines changed
6 files changed +433
-445
lines changed Original file line number Diff line number Diff line change @@ -268,10 +268,9 @@ public struct CountableClosedRange<
268
268
269
269
@warn_unused_result
270
270
public func _customContainsEquatableElement( _ element: Bound ) -> Bool ? {
271
- return element >= self . lowerBound && element < self . upperBound
271
+ return element >= self . lowerBound && element <= self . upperBound
272
272
}
273
273
274
-
275
274
/// Returns `true` iff `self.contains(x)` is `false` for all values of `x`.
276
275
public var isEmpty : Bool {
277
276
return false
Original file line number Diff line number Diff line change @@ -159,12 +159,6 @@ extension HalfOpenRangeProtocol {
159
159
uncheckedBounds: ( lower: other. lowerBound, upper: other. upperBound)
160
160
)
161
161
}
162
-
163
- /// Returns `true` iff `lowerBound <= value && upperBound > value`.
164
- @inline ( __always)
165
- public func contains( _ value: Bound ) -> Bool {
166
- return lowerBound <= value && upperBound > value
167
- }
168
162
169
163
/// A textual representation of `self`.
170
164
public var description : String {
@@ -326,7 +320,7 @@ public struct CountableRange<
326
320
327
321
@warn_unused_result
328
322
public func _customContainsEquatableElement( _ element: Element ) -> Bool ? {
329
- return element >= self . lowerBound && element < self . upperBound
323
+ return lowerBound <= element && element < upperBound
330
324
}
331
325
332
326
/// Returns `true` iff `self.contains(x)` is `false` for all values of `x`.
@@ -507,7 +501,7 @@ public struct Range<
507
501
/// `upperBound`.
508
502
@warn_unused_result
509
503
public func contains( _ element: Bound ) -> Bool {
510
- return element >= self . lowerBound && element < self . upperBound
504
+ return lowerBound <= element && element < upperBound
511
505
}
512
506
513
507
/// Returns `true` iff `self.contains(x)` is `false` for all values of `x`.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments