Skip to content

Commit 824e4d0

Browse files
[SE-0270] Reset availability of RangeSet APIs (#34567)
1 parent e675740 commit 824e4d0

File tree

6 files changed

+24
-24
lines changed

6 files changed

+24
-24
lines changed

stdlib/public/core/CollectionAlgorithms.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ extension Collection {
231231
/// returns `true`.
232232
///
233233
/// - Complexity: O(*n*), where *n* is the length of the collection.
234-
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
234+
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
235235
public func subranges(where predicate: (Element) throws -> Bool) rethrows
236236
-> RangeSet<Index>
237237
{
@@ -267,7 +267,7 @@ extension Collection where Element: Equatable {
267267
/// `element`.
268268
///
269269
/// - Complexity: O(*n*), where *n* is the length of the collection.
270-
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
270+
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
271271
public func subranges(of element: Element) -> RangeSet<Index> {
272272
subranges(where: { $0 == element })
273273
}

stdlib/public/core/DiscontiguousSlice.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
/// A collection wrapper that provides access to the elements of a collection,
1414
/// indexed by a set of indices.
15-
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
15+
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
1616
@frozen
1717
public struct DiscontiguousSlice<Base: Collection> {
1818
/// The collection that the indexed collection wraps.
@@ -22,7 +22,7 @@ public struct DiscontiguousSlice<Base: Collection> {
2222
public var subranges: RangeSet<Base.Index>
2323
}
2424

25-
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
25+
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
2626
extension DiscontiguousSlice {
2727
/// A position in an `DiscontiguousSlice`.
2828
@frozen
@@ -39,10 +39,10 @@ extension DiscontiguousSlice {
3939
}
4040
}
4141

42-
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
42+
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
4343
extension DiscontiguousSlice.Index: Hashable where Base.Index: Hashable {}
4444

45-
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
45+
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
4646
extension DiscontiguousSlice: Collection {
4747
public typealias SubSequence = Self
4848

@@ -83,7 +83,7 @@ extension DiscontiguousSlice: Collection {
8383
}
8484
}
8585

86-
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
86+
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
8787
extension DiscontiguousSlice {
8888
public var count: Int {
8989
var c = 0
@@ -102,7 +102,7 @@ extension DiscontiguousSlice {
102102
}
103103
}
104104

105-
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
105+
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
106106
extension DiscontiguousSlice: BidirectionalCollection
107107
where Base: BidirectionalCollection
108108
{
@@ -122,7 +122,7 @@ extension DiscontiguousSlice: BidirectionalCollection
122122
}
123123
}
124124

125-
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
125+
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
126126
extension DiscontiguousSlice: MutableCollection where Base: MutableCollection {
127127
public subscript(i: Index) -> Base.Element {
128128
get {
@@ -145,7 +145,7 @@ extension Collection {
145145
/// - Returns: A collection of the elements at the positions in `subranges`.
146146
///
147147
/// - Complexity: O(1)
148-
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
148+
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
149149
public subscript(subranges: RangeSet<Index>) -> DiscontiguousSlice<Self> {
150150
DiscontiguousSlice(base: self, subranges: subranges)
151151
}
@@ -162,7 +162,7 @@ extension MutableCollection {
162162
/// - Complexity: O(1) to access the elements, O(*m*) to mutate the
163163
/// elements at the positions in `subranges`, where *m* is the number of
164164
/// elements indicated by `subranges`.
165-
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
165+
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
166166
public subscript(subranges: RangeSet<Index>) -> DiscontiguousSlice<Self> {
167167
get {
168168
DiscontiguousSlice(base: self, subranges: subranges)
@@ -196,7 +196,7 @@ extension Collection {
196196
/// - Returns: A collection of the elements that are not in `subranges`.
197197
///
198198
/// - Complexity: O(*n*), where *n* is the length of the collection.
199-
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
199+
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
200200
public func removingSubranges(
201201
_ subranges: RangeSet<Index>
202202
) -> DiscontiguousSlice<Self> {

stdlib/public/core/MutableCollection.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ extension MutableCollection {
290290
/// - Returns: The new bounds of the moved elements.
291291
///
292292
/// - Complexity: O(*n* log *n*) where *n* is the length of the collection.
293-
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
293+
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
294294
@discardableResult
295295
public mutating func moveSubranges(
296296
_ subranges: RangeSet<Index>, to insertionPoint: Index

stdlib/public/core/RangeReplaceableCollection.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@ extension RangeReplaceableCollection {
11781178
/// - Parameter subranges: The indices of the elements to remove.
11791179
///
11801180
/// - Complexity: O(*n*), where *n* is the length of the collection.
1181-
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
1181+
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
11821182
public mutating func removeSubranges(_ subranges: RangeSet<Index>) {
11831183
guard !subranges.isEmpty else {
11841184
return
@@ -1208,7 +1208,7 @@ extension MutableCollection where Self: RangeReplaceableCollection {
12081208
/// - Parameter subranges: The indices of the elements to remove.
12091209
///
12101210
/// - Complexity: O(*n*), where *n* is the length of the collection.
1211-
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
1211+
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
12121212
public mutating func removeSubranges(_ subranges: RangeSet<Index>) {
12131213
guard let firstRange = subranges.ranges.first else {
12141214
return

stdlib/public/core/RangeSet.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
///
2727
/// numbers.moveSubranges(negativeSubranges, to: 0)
2828
/// // numbers == [-5, -3, -9, 10, 12, 14, 15]
29-
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
29+
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
3030
public struct RangeSet<Bound: Comparable> {
3131
internal var _ranges = _RangeSetStorage<Bound>()
3232

@@ -238,15 +238,15 @@ public struct RangeSet<Bound: Comparable> {
238238
}
239239
}
240240

241-
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
241+
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
242242
extension RangeSet: Equatable {}
243243

244-
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
244+
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
245245
extension RangeSet: Hashable where Bound: Hashable {}
246246

247247
// MARK: - Range Collection
248248

249-
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
249+
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
250250
extension RangeSet {
251251
/// A collection of the ranges that make up a range set.
252252
public struct Ranges: RandomAccessCollection {
@@ -271,7 +271,7 @@ extension RangeSet {
271271

272272
// MARK: - Collection APIs
273273

274-
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
274+
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
275275
extension RangeSet {
276276
/// Creates a new range set containing ranges that contain only the
277277
/// specified indices in the given collection.
@@ -365,7 +365,7 @@ extension RangeSet {
365365

366366
// These methods only depend on the ranges that comprise the range set, so
367367
// we can provide them even when we can't provide `SetAlgebra` conformance.
368-
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
368+
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
369369
extension RangeSet {
370370
/// Adds the contents of the given range set to this range set.
371371
///
@@ -549,7 +549,7 @@ extension RangeSet {
549549
}
550550
}
551551

552-
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
552+
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
553553
extension RangeSet: CustomStringConvertible {
554554
public var description: String {
555555
let rangesDescription = _ranges

validation-test/StdlibUnittest/RangeSet.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import StdlibUnittest
55
import StdlibCollectionUnittest
66

7-
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
7+
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
88
extension RangeSet: ExpressibleByArrayLiteral {
99
public init(arrayLiteral elements: Range<Bound>...) {
1010
self.init(elements)
@@ -21,7 +21,7 @@ extension Collection {
2121

2222
let RangeSetTests = TestSuite("RangeSet")
2323

24-
if #available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *) {
24+
if #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) {
2525
let parent = -200..<200
2626
let source: RangeSet = [1..<5, 8..<10, 20..<22, 27..<29]
2727

0 commit comments

Comments
 (0)