mirror of
https://github.com/apple/swift-collections
synced 2026-11-25 04:37:48 +00:00
[PersistentSet] Iterator.next(): Make inlinable
For a cool 4x performance improvement. 😣
This commit is contained in:
1 parent
5e80c92941
commit
14e86daeeb
1 file changed
+1
@@ -30,6 +30,7 @@ extension PersistentSet: Sequence {
|
||||
/// Once `nil` has been returned, all subsequent calls return `nil`.
|
||||
///
|
||||
/// - Complexity: O(1)
|
||||
@inlinable
|
||||
public mutating func next() -> Element? {
|
||||
guard let (node, slot) = _it.next() else { return nil }
|
||||
return _UnsafeHandle.read(node) { $0[item: slot].key }
|
||||
|
||||
Reference in new issue
Block a user