Skip to content

Commit 89aa806

Browse files
committed
[stdlib] Force-inline native Set iterators
1 parent 6cb5465 commit 89aa806

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

stdlib/public/core/NativeSet.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,20 +494,23 @@ extension _NativeSet: Sequence {
494494
internal var iterator: _HashTable.Iterator
495495

496496
@inlinable
497+
@inline(__always)
497498
init(_ base: __owned _NativeSet) {
498499
self.base = base
499500
self.iterator = base.hashTable.makeIterator()
500501
}
501502
}
502503

503504
@inlinable
505+
@inline(__always)
504506
internal __consuming func makeIterator() -> Iterator {
505507
return Iterator(self)
506508
}
507509
}
508510

509511
extension _NativeSet.Iterator: IteratorProtocol {
510512
@inlinable
513+
@inline(__always)
511514
internal mutating func next() -> Element? {
512515
guard let index = iterator.next() else { return nil }
513516
return base.uncheckedElement(at: index)

0 commit comments

Comments
 (0)