We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
indexes
1 parent 70ad269 commit 4c4100fCopy full SHA for 4c4100f
Sources/Algorithms/Combinations.swift
@@ -124,7 +124,8 @@ extension Combinations: Sequence {
124
if kRange.lowerBound < kRange.upperBound {
125
let advancedLowerBound = kRange.lowerBound + 1
126
kRange = advancedLowerBound..<kRange.upperBound
127
- self.indexes = Array(base.indices.prefix(kRange.lowerBound))
+ indexes.removeAll(keepingCapacity: true)
128
+ indexes.append(contentsOf: base.indices.prefix(kRange.lowerBound))
129
}
130
131
0 commit comments