Skip to content

Commit 45429ff

Browse files
dennisvenninkstephentyrone
authored andcommitted
Add Zip2Sequence.underestimatedCount (#21530)
1 parent 9afa479 commit 45429ff

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

stdlib/public/core/Zip.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,12 @@ extension Zip2Sequence: Sequence {
144144
_sequence1.makeIterator(),
145145
_sequence2.makeIterator())
146146
}
147+
148+
@inlinable // generic-performance
149+
public var underestimatedCount: Int {
150+
return Swift.min(
151+
_sequence1.underestimatedCount,
152+
_sequence2.underestimatedCount
153+
)
154+
}
147155
}

0 commit comments

Comments
 (0)