Skip to content

Commit

Permalink
Explain why more() returns always false. (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
Carreau committed Aug 25, 2023
1 parent d56b823 commit bdfad24
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/iterators/recorded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ impl<T: Counter> PickyIterator<T> for Iter {
}

fn more(&mut self, _: usize) -> bool {
// more() is really more_with_zero_counts(), but here as this is the
// record-picker, we never visit empty bins, and thus there will never
// be `more()`
//
// If we yield a record, by definition the current bin cannot be empty,
// and as we iterate over record, once the last one is yielded, there
// can't any more bins to yield.
false
}
}

0 comments on commit bdfad24

Please sign in to comment.