Skip to content

Commit 85f126f

Browse files
author
Matt Zanchelli
committed
Increment range’s bound with + 1 instead of advanced(by: 1)
1 parent 2586187 commit 85f126f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/Algorithms/Combinations.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ extension Combinations: Sequence {
122122
internal mutating func advance() {
123123
/// Advances `k` by increasing its `lowerBound` or finishes the iteration.
124124
func advanceK() {
125-
let advancedLowerBound = k.lowerBound.advanced(by: 1)
125+
let advancedLowerBound = k.lowerBound + 1
126126
if advancedLowerBound < k.upperBound {
127127
k = advancedLowerBound..<k.upperBound
128128
self.indexes = Array(base.indices.prefix(k.lowerBound))

0 commit comments

Comments
 (0)