Skip to content

Commit 97a830b

Browse files
committed
[SE-0121] remove use of optional comparison operators
1 parent da487bb commit 97a830b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Foundation/IndexSet.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,12 +432,12 @@ public struct IndexSet : ReferenceConvertible, Equatable, BidirectionalCollectio
432432
///
433433
/// - parameter range: The range of integers to include.
434434
public func indexRange(in range: Range<Element>) -> Range<Index> {
435-
if range.isEmpty {
435+
if isEmpty || range.isEmpty {
436436
let i = Index(indexSet: self, index: 0)
437437
return i..<i
438438
}
439439

440-
if range.lowerBound > last || (range.upperBound - 1) < first {
440+
if range.lowerBound > last! || (range.upperBound - 1) < first! {
441441
let i = Index(indexSet: self, index: 0)
442442
return i..<i
443443
}

0 commit comments

Comments
 (0)