Skip to content

Commit

Permalink
perf: speed up PoseidonGrainLFSR::new
Browse files Browse the repository at this point in the history
Signed-off-by: ljedrz <[email protected]>
  • Loading branch information
ljedrz committed Aug 16, 2023
1 parent 9fe9b91 commit cda295b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions fields/src/traits/poseidon_grain_lfsr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,8 @@ impl PoseidonGrainLFSR {
}
}

#[allow(clippy::needless_range_loop)]
// b50, ..., b79 are set to 1
for i in 50..=79 {
state[i] = true;
}
state[50..=79].copy_from_slice(&[true; 30]);

// Initialize.
let mut res = Self { field_size_in_bits, state, head: 0 };
Expand Down

0 comments on commit cda295b

Please sign in to comment.