Skip to content

Commit d01046c

Browse files
committed
Minor changes for consistency with SDK version
1 parent 8654d0c commit d01046c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Foundation/IndexSet.swift

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ public struct IndexSet : ReferenceConvertible, Equatable, BidirectionalCollectio
463463
} else {
464464
let extent = 0..<0
465465
let rangeIndex = 0
466-
return Index(value: value, extent: Range(extent), rangeIndex: rangeIndex, rangeCount: rangeCount)
466+
return Index(value: value, extent: extent, rangeIndex: rangeIndex, rangeCount: rangeCount)
467467
}
468468
}
469469

@@ -481,11 +481,11 @@ public struct IndexSet : ReferenceConvertible, Equatable, BidirectionalCollectio
481481

482482
var result = IndexSet()
483483
for r in self.rangeView {
484-
result.insert(integersIn: Range(r))
484+
result.insert(integersIn: r)
485485
}
486486

487487
for r in other.rangeView {
488-
result.insert(integersIn: Range(r))
488+
result.insert(integersIn: r)
489489
}
490490
return result
491491
}
@@ -641,7 +641,9 @@ public struct IndexSet : ReferenceConvertible, Equatable, BidirectionalCollectio
641641
///
642642
/// - parameter range: A range of integers. For each integer in the range that intersects the integers in the IndexSet, then the `includeInteger` predicate will be invoked.
643643
/// - parameter includeInteger: The predicate which decides if an integer will be included in the result or not.
644-
public func filteredIndexSet(in range : ClosedRange<Element>, includeInteger: (Element) throws -> Bool) rethrows -> IndexSet { return try self.filteredIndexSet(in: Range(range), includeInteger: includeInteger) }
644+
public func filteredIndexSet(in range : ClosedRange<Element>, includeInteger: (Element) throws -> Bool) rethrows -> IndexSet {
645+
return try self.filteredIndexSet(in: Range(range), includeInteger: includeInteger)
646+
}
645647

646648
/// Returns an IndexSet filtered according to the result of `includeInteger`.
647649
///
@@ -651,7 +653,7 @@ public struct IndexSet : ReferenceConvertible, Equatable, BidirectionalCollectio
651653
}
652654

653655
/// For a positive delta, shifts the indexes in [index, INT_MAX] to the right, thereby inserting an "empty space" [index, delta], for a negative delta, shifts the indexes in [index, INT_MAX] to the left, thereby deleting the indexes in the range [index - delta, delta].
654-
public mutating func shift(startingAt integer: Element, by delta: IndexSet.IndexDistance) {
656+
public mutating func shift(startingAt integer: Element, by delta: Int) {
655657
_applyMutation { $0.shiftIndexesStarting(at: integer, by: delta) }
656658
}
657659

@@ -929,4 +931,3 @@ extension IndexSet : Codable {
929931
}
930932
}
931933
}
932-

0 commit comments

Comments
 (0)