From cda295b4bc6a26e840789294f25936edb9075125 Mon Sep 17 00:00:00 2001 From: ljedrz Date: Wed, 16 Aug 2023 10:33:11 +0200 Subject: [PATCH] perf: speed up PoseidonGrainLFSR::new Signed-off-by: ljedrz --- fields/src/traits/poseidon_grain_lfsr.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fields/src/traits/poseidon_grain_lfsr.rs b/fields/src/traits/poseidon_grain_lfsr.rs index f6c0b7ad63..c8931f4f68 100644 --- a/fields/src/traits/poseidon_grain_lfsr.rs +++ b/fields/src/traits/poseidon_grain_lfsr.rs @@ -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 };