diff --git a/beacon_chain/utils/shuffling/src/lib.rs b/beacon_chain/utils/shuffling/src/lib.rs index 91a3a73e2..9691240f8 100644 --- a/beacon_chain/utils/shuffling/src/lib.rs +++ b/beacon_chain/utils/shuffling/src/lib.rs @@ -34,7 +34,7 @@ pub fn shuffle( return Ok(list); } - for i in 0..(list.len() - 1) { + for i in 0..(list.len().saturating_sub(1)) { let n = list.len() - i; let j = rng.rand_range(n as u32) as usize + i; list.swap(i, j);