File tree Expand file tree Collapse file tree 4 files changed +48
-0
lines changed Expand file tree Collapse file tree 4 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -647,6 +647,11 @@ extension Dictionary: Collection {
647
647
return _variant. index ( after: i)
648
648
}
649
649
650
+ @inlinable
651
+ public func formIndex( after i: inout Index ) {
652
+ _variant. formIndex ( after: & i)
653
+ }
654
+
650
655
/// Returns the index for the given key.
651
656
///
652
657
/// If the given key is found in the dictionary, this method returns an index
@@ -1350,6 +1355,11 @@ extension Dictionary {
1350
1355
return _variant. index ( after: i)
1351
1356
}
1352
1357
1358
+ @inlinable
1359
+ public func formIndex( after i: inout Index ) {
1360
+ _variant. formIndex ( after: & i)
1361
+ }
1362
+
1353
1363
@inlinable
1354
1364
public subscript( position: Index ) -> Element {
1355
1365
return _variant. key ( at: position)
@@ -1456,6 +1466,11 @@ extension Dictionary {
1456
1466
return _variant. index ( after: i)
1457
1467
}
1458
1468
1469
+ @inlinable
1470
+ public func formIndex( after i: inout Index ) {
1471
+ _variant. formIndex ( after: & i)
1472
+ }
1473
+
1459
1474
@inlinable
1460
1475
public subscript( position: Index ) -> Element {
1461
1476
// FIXME(accessors): Provide a _read
Original file line number Diff line number Diff line change @@ -189,6 +189,20 @@ extension Dictionary._Variant: _DictionaryBuffer {
189
189
}
190
190
}
191
191
192
+ @inlinable
193
+ internal func formIndex( after index: inout Index ) {
194
+ switch self {
195
+ case . native( let native) :
196
+ index = native. index ( after: index)
197
+ #if _runtime(_ObjC)
198
+ case . cocoa( let cocoa) :
199
+ cocoaPath ( )
200
+ let isUnique = index. _isUniquelyReferenced ( )
201
+ cocoa. formIndex ( after: & index. _asCocoa, isUnique: isUnique)
202
+ #endif
203
+ }
204
+ }
205
+
192
206
@inlinable
193
207
@inline ( __always)
194
208
internal func index( forKey key: Key ) -> Index ? {
Original file line number Diff line number Diff line change @@ -340,6 +340,11 @@ extension Set: Collection {
340
340
return _variant. index ( after: i)
341
341
}
342
342
343
+ @inlinable
344
+ public func formIndex( after i: inout Index ) {
345
+ _variant. formIndex ( after: & i)
346
+ }
347
+
343
348
// APINAMING: complexity docs are broadly missing in this file.
344
349
345
350
/// Returns the index of the given element in the set, or `nil` if the
Original file line number Diff line number Diff line change @@ -182,6 +182,20 @@ extension Set._Variant: _SetBuffer {
182
182
}
183
183
}
184
184
185
+ @inlinable
186
+ internal func formIndex( after index: inout Index ) {
187
+ switch self {
188
+ case . native( let native) :
189
+ index = native. index ( after: index)
190
+ #if _runtime(_ObjC)
191
+ case . cocoa( let cocoa) :
192
+ cocoaPath ( )
193
+ let isUnique = index. _isUniquelyReferenced ( )
194
+ cocoa. formIndex ( after: & index. _asCocoa, isUnique: isUnique)
195
+ #endif
196
+ }
197
+ }
198
+
185
199
@inlinable
186
200
@inline ( __always)
187
201
internal func index( for element: Element ) -> Index ? {
You can’t perform that action at this time.
0 commit comments