Skip to content

Commit 06937d8

Browse files
authored
[stdlib] Update availability of EnumeratedSequence collection conformance (#80471)
1 parent d1a0405 commit 06937d8

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

stdlib/public/core/EnumeratedSequence.swift

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ extension EnumeratedSequence: Sequence {
9898
}
9999
}
100100

101-
@available(SwiftStdlib 6.1, *)
101+
@available(SwiftStdlib 6.2, *)
102102
extension EnumeratedSequence: Collection where Base: Collection {
103-
@available(SwiftStdlib 6.1, *)
103+
@available(SwiftStdlib 6.2, *)
104104
@frozen
105105
public struct Index {
106106
/// The position in the underlying collection.
@@ -111,33 +111,33 @@ extension EnumeratedSequence: Collection where Base: Collection {
111111
@usableFromInline
112112
let _offset: Int
113113

114-
@available(SwiftStdlib 6.1, *)
114+
@available(SwiftStdlib 6.2, *)
115115
@_alwaysEmitIntoClient
116116
init(base: Base.Index, offset: Int) {
117117
self.base = base
118118
self._offset = offset
119119
}
120120
}
121121

122-
@available(SwiftStdlib 6.1, *)
122+
@available(SwiftStdlib 6.2, *)
123123
@_alwaysEmitIntoClient
124124
public var startIndex: Index {
125125
Index(base: _base.startIndex, offset: 0)
126126
}
127127

128-
@available(SwiftStdlib 6.1, *)
128+
@available(SwiftStdlib 6.2, *)
129129
@_alwaysEmitIntoClient
130130
public var endIndex: Index {
131131
Index(base: _base.endIndex, offset: 0)
132132
}
133133

134-
@available(SwiftStdlib 6.1, *)
134+
@available(SwiftStdlib 6.2, *)
135135
@_alwaysEmitIntoClient
136136
public var count: Int {
137137
_base.count
138138
}
139139

140-
@available(SwiftStdlib 6.1, *)
140+
@available(SwiftStdlib 6.2, *)
141141
@_alwaysEmitIntoClient
142142
public var isEmpty: Bool {
143143
_base.isEmpty
@@ -147,13 +147,13 @@ extension EnumeratedSequence: Collection where Base: Collection {
147147
///
148148
/// - Complexity: O(*n*) if `index == endIndex` and `Base` does not conform to
149149
/// `RandomAccessCollection`, O(1) otherwise.
150-
@available(SwiftStdlib 6.1, *)
150+
@available(SwiftStdlib 6.2, *)
151151
@_alwaysEmitIntoClient
152152
func _offset(of index: Index) -> Int {
153153
index.base == _base.endIndex ? _base.count : index._offset
154154
}
155155

156-
@available(SwiftStdlib 6.1, *)
156+
@available(SwiftStdlib 6.2, *)
157157
@_alwaysEmitIntoClient
158158
public func distance(from start: Index, to end: Index) -> Int {
159159
if start.base == _base.endIndex || end.base == _base.endIndex {
@@ -163,21 +163,21 @@ extension EnumeratedSequence: Collection where Base: Collection {
163163
}
164164
}
165165

166-
@available(SwiftStdlib 6.1, *)
166+
@available(SwiftStdlib 6.2, *)
167167
@_alwaysEmitIntoClient
168168
public func index(after index: Index) -> Index {
169169
Index(base: _base.index(after: index.base), offset: index._offset + 1)
170170
}
171171

172-
@available(SwiftStdlib 6.1, *)
172+
@available(SwiftStdlib 6.2, *)
173173
@_alwaysEmitIntoClient
174174
public func index(_ i: Index, offsetBy distance: Int) -> Index {
175175
let index = _base.index(i.base, offsetBy: distance)
176176
let offset = distance >= 0 ? i._offset : _offset(of: i)
177177
return Index(base: index, offset: offset + distance)
178178
}
179179

180-
@available(SwiftStdlib 6.1, *)
180+
@available(SwiftStdlib 6.2, *)
181181
@_alwaysEmitIntoClient
182182
public func index(
183183
_ i: Index,
@@ -196,7 +196,7 @@ extension EnumeratedSequence: Collection where Base: Collection {
196196
return Index(base: index, offset: offset + distance)
197197
}
198198

199-
@available(SwiftStdlib 6.1, *)
199+
@available(SwiftStdlib 6.2, *)
200200
@_alwaysEmitIntoClient
201201
public subscript(_ position: Index) -> Element {
202202
_precondition(
@@ -208,29 +208,29 @@ extension EnumeratedSequence: Collection where Base: Collection {
208208
}
209209
}
210210

211-
@available(SwiftStdlib 6.1, *)
211+
@available(SwiftStdlib 6.2, *)
212212
extension EnumeratedSequence.Index: Comparable {
213-
@available(SwiftStdlib 6.1, *)
213+
@available(SwiftStdlib 6.2, *)
214214
@_alwaysEmitIntoClient
215215
public static func ==(lhs: Self, rhs: Self) -> Bool {
216216
lhs.base == rhs.base
217217
}
218218

219-
@available(SwiftStdlib 6.1, *)
219+
@available(SwiftStdlib 6.2, *)
220220
@_alwaysEmitIntoClient
221221
public static func <(lhs: Self, rhs: Self) -> Bool {
222222
lhs.base < rhs.base
223223
}
224224
}
225225

226-
@available(SwiftStdlib 6.1, *)
226+
@available(SwiftStdlib 6.2, *)
227227
extension EnumeratedSequence: BidirectionalCollection where Base: BidirectionalCollection & RandomAccessCollection {
228-
@available(SwiftStdlib 6.1, *)
228+
@available(SwiftStdlib 6.2, *)
229229
@_alwaysEmitIntoClient
230230
public func index(before index: Index) -> Index {
231231
Index(base: _base.index(before: index.base), offset: _offset(of: index) - 1)
232232
}
233233
}
234234

235-
@available(SwiftStdlib 6.1, *)
235+
@available(SwiftStdlib 6.2, *)
236236
extension EnumeratedSequence: RandomAccessCollection where Base: RandomAccessCollection {}

0 commit comments

Comments
 (0)