Skip to content

Commit c763dfa

Browse files
committed
Use range instead of manual loop
1 parent 298c464 commit c763dfa

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/combinations.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,8 @@ impl<I> Iterator for Combinations<I>
8282

8383
// Increment index, and reset the ones to its right
8484
self.indices[i] += 1;
85-
let mut j = i + 1;
86-
while j < self.indices.len() {
85+
for j in i+1..self.indices.len() {
8786
self.indices[j] = self.indices[j - 1] + 1;
88-
j += 1;
8987
}
9088
}
9189

0 commit comments

Comments
 (0)