mirror of
https://github.com/apple/swift-algorithms
synced 2026-11-24 04:17:48 +00:00
CombinationsSequence: underestimatedCount == count (#220)
Not doing this makes it needlessly costly to create an Array of the results.
This commit is contained in:
1 parent
c3b3acbca3
commit
9dd88e5eaf
2 files changed
+56
-46
No files matched your search
@@ -78,6 +78,10 @@ public struct CombinationsSequence<Base: Collection> {
|
||||
binomial(n: n, k: $0)
|
||||
}.reduce(0, +)
|
||||
}
|
||||
|
||||
/// The total number of combinations.
|
||||
@inlinable
|
||||
public var underestimatedCount: Int { count }
|
||||
}
|
||||
|
||||
extension CombinationsSequence: Sequence {
|
||||
|
||||
Reference in new issue
Block a user