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.
1 parent 514af56 commit 5f0e1bbCopy full SHA for 5f0e1bb
src/duplicates_impl.rs
@@ -89,7 +89,7 @@ mod private {
89
// far), plus (hi - pending) / 2 pairs of never seen before items.
90
let hi = hi.map(|hi| {
91
let max_pending = std::cmp::min(self.meta.pending, hi);
92
- let max_new = hi.checked_sub(self.meta.pending).unwrap_or(0) / 2;
+ let max_new = hi.saturating_sub(self.meta.pending) / 2;
93
max_pending + max_new
94
});
95
// The lower bound is always 0 since we might only get unique items from now on
0 commit comments