[PersistentSet] Iterator.next(): Make inlinable

For a cool 4x performance improvement. 😣
This commit is contained in:
Karoy Lorentey committed 2022-10-31 14:03:49 -07:00
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 }