Skip to content

Commit

Permalink
Avoid redundant call to is_done
Browse files Browse the repository at this point in the history
get_next does the same check internally.
  • Loading branch information
phimuemue committed Feb 29, 2020
1 parent c92f6a5 commit 9e27154
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/combinations.rs
Expand Up @@ -63,7 +63,7 @@ impl<I> Iterator for Combinations<I>
let mut i: usize = self.indices.len() - 1;

// Check if we need to consume more from the iterator
if self.indices[i] == self.pool.len() - 1 && !self.pool.is_done() {
if self.indices[i] == self.pool.len() - 1 {
self.pool.get_next(); // may change pool size
}

Expand Down

0 comments on commit 9e27154

Please sign in to comment.