@@ -98,9 +98,9 @@ extension EnumeratedSequence: Sequence {
98
98
}
99
99
}
100
100
101
- @available ( SwiftStdlib 6 . 1 , * )
101
+ @available ( SwiftStdlib 6 . 2 , * )
102
102
extension EnumeratedSequence : Collection where Base: Collection {
103
- @available ( SwiftStdlib 6 . 1 , * )
103
+ @available ( SwiftStdlib 6 . 2 , * )
104
104
@frozen
105
105
public struct Index {
106
106
/// The position in the underlying collection.
@@ -111,33 +111,33 @@ extension EnumeratedSequence: Collection where Base: Collection {
111
111
@usableFromInline
112
112
let _offset : Int
113
113
114
- @available ( SwiftStdlib 6 . 1 , * )
114
+ @available ( SwiftStdlib 6 . 2 , * )
115
115
@_alwaysEmitIntoClient
116
116
init ( base: Base . Index , offset: Int ) {
117
117
self . base = base
118
118
self . _offset = offset
119
119
}
120
120
}
121
121
122
- @available ( SwiftStdlib 6 . 1 , * )
122
+ @available ( SwiftStdlib 6 . 2 , * )
123
123
@_alwaysEmitIntoClient
124
124
public var startIndex : Index {
125
125
Index ( base: _base. startIndex, offset: 0 )
126
126
}
127
127
128
- @available ( SwiftStdlib 6 . 1 , * )
128
+ @available ( SwiftStdlib 6 . 2 , * )
129
129
@_alwaysEmitIntoClient
130
130
public var endIndex : Index {
131
131
Index ( base: _base. endIndex, offset: 0 )
132
132
}
133
133
134
- @available ( SwiftStdlib 6 . 1 , * )
134
+ @available ( SwiftStdlib 6 . 2 , * )
135
135
@_alwaysEmitIntoClient
136
136
public var count : Int {
137
137
_base. count
138
138
}
139
139
140
- @available ( SwiftStdlib 6 . 1 , * )
140
+ @available ( SwiftStdlib 6 . 2 , * )
141
141
@_alwaysEmitIntoClient
142
142
public var isEmpty : Bool {
143
143
_base. isEmpty
@@ -147,13 +147,13 @@ extension EnumeratedSequence: Collection where Base: Collection {
147
147
///
148
148
/// - Complexity: O(*n*) if `index == endIndex` and `Base` does not conform to
149
149
/// `RandomAccessCollection`, O(1) otherwise.
150
- @available ( SwiftStdlib 6 . 1 , * )
150
+ @available ( SwiftStdlib 6 . 2 , * )
151
151
@_alwaysEmitIntoClient
152
152
func _offset( of index: Index ) -> Int {
153
153
index. base == _base. endIndex ? _base. count : index. _offset
154
154
}
155
155
156
- @available ( SwiftStdlib 6 . 1 , * )
156
+ @available ( SwiftStdlib 6 . 2 , * )
157
157
@_alwaysEmitIntoClient
158
158
public func distance( from start: Index , to end: Index ) -> Int {
159
159
if start. base == _base. endIndex || end. base == _base. endIndex {
@@ -163,21 +163,21 @@ extension EnumeratedSequence: Collection where Base: Collection {
163
163
}
164
164
}
165
165
166
- @available ( SwiftStdlib 6 . 1 , * )
166
+ @available ( SwiftStdlib 6 . 2 , * )
167
167
@_alwaysEmitIntoClient
168
168
public func index( after index: Index ) -> Index {
169
169
Index ( base: _base. index ( after: index. base) , offset: index. _offset + 1 )
170
170
}
171
171
172
- @available ( SwiftStdlib 6 . 1 , * )
172
+ @available ( SwiftStdlib 6 . 2 , * )
173
173
@_alwaysEmitIntoClient
174
174
public func index( _ i: Index , offsetBy distance: Int ) -> Index {
175
175
let index = _base. index ( i. base, offsetBy: distance)
176
176
let offset = distance >= 0 ? i. _offset : _offset ( of: i)
177
177
return Index ( base: index, offset: offset + distance)
178
178
}
179
179
180
- @available ( SwiftStdlib 6 . 1 , * )
180
+ @available ( SwiftStdlib 6 . 2 , * )
181
181
@_alwaysEmitIntoClient
182
182
public func index(
183
183
_ i: Index ,
@@ -196,7 +196,7 @@ extension EnumeratedSequence: Collection where Base: Collection {
196
196
return Index ( base: index, offset: offset + distance)
197
197
}
198
198
199
- @available ( SwiftStdlib 6 . 1 , * )
199
+ @available ( SwiftStdlib 6 . 2 , * )
200
200
@_alwaysEmitIntoClient
201
201
public subscript( _ position: Index ) -> Element {
202
202
_precondition (
@@ -208,29 +208,29 @@ extension EnumeratedSequence: Collection where Base: Collection {
208
208
}
209
209
}
210
210
211
- @available ( SwiftStdlib 6 . 1 , * )
211
+ @available ( SwiftStdlib 6 . 2 , * )
212
212
extension EnumeratedSequence . Index : Comparable {
213
- @available ( SwiftStdlib 6 . 1 , * )
213
+ @available ( SwiftStdlib 6 . 2 , * )
214
214
@_alwaysEmitIntoClient
215
215
public static func == ( lhs: Self , rhs: Self ) -> Bool {
216
216
lhs. base == rhs. base
217
217
}
218
218
219
- @available ( SwiftStdlib 6 . 1 , * )
219
+ @available ( SwiftStdlib 6 . 2 , * )
220
220
@_alwaysEmitIntoClient
221
221
public static func < ( lhs: Self , rhs: Self ) -> Bool {
222
222
lhs. base < rhs. base
223
223
}
224
224
}
225
225
226
- @available ( SwiftStdlib 6 . 1 , * )
226
+ @available ( SwiftStdlib 6 . 2 , * )
227
227
extension EnumeratedSequence : BidirectionalCollection where Base: BidirectionalCollection & RandomAccessCollection {
228
- @available ( SwiftStdlib 6 . 1 , * )
228
+ @available ( SwiftStdlib 6 . 2 , * )
229
229
@_alwaysEmitIntoClient
230
230
public func index( before index: Index ) -> Index {
231
231
Index ( base: _base. index ( before: index. base) , offset: _offset ( of: index) - 1 )
232
232
}
233
233
}
234
234
235
- @available ( SwiftStdlib 6 . 1 , * )
235
+ @available ( SwiftStdlib 6 . 2 , * )
236
236
extension EnumeratedSequence : RandomAccessCollection where Base: RandomAccessCollection { }
0 commit comments