We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 26498f5 commit 9b4cb27Copy full SHA for 9b4cb27
src/uu/shuf/src/nonrepeating_iterator.rs
@@ -54,7 +54,7 @@ impl<'a> NonrepeatingIterator<'a> {
54
Values::Full(items) => {
55
let this_idx = items.len() - 1;
56
57
- let other_idx = self.rng.choose_from_range(0..=items.len() as u64 - 1)? as usize;
+ let other_idx = self.rng.choose_from_range(0..(items.len() as u64))? as usize;
58
// Flip the index to pretend we're going left-to-right
59
let other_idx = items.len() - other_idx - 1;
60
0 commit comments