Skip to content

Commit 1fe181f

Browse files
prestwichclaude
andcommitted
chore: appease clippy needless_range_loop in square_redc reduction
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UJ4S2Ns5cyvmkTFJ7mgrWE
1 parent fae472a commit 1fe181f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/algorithms/mul_redc.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ pub fn square_redc<const N: usize>(a: [u64; N], modulus: [u64; N], inv: u64) ->
135135
// limb i + N + 1 — exactly the next round's final add, so `carry_top`
136136
// hands it forward.
137137
let mut carry_top = false;
138-
for i in 0..N {
138+
for &hi_limb in &hi {
139139
let m = lo[0].wrapping_mul(inv);
140140
let (value, mut carry) = carrying_mul_add(m, modulus[0], lo[0], 0);
141141
debug_assert_eq!(value, 0);
@@ -144,7 +144,7 @@ pub fn square_redc<const N: usize>(a: [u64; N], modulus: [u64; N], inv: u64) ->
144144
lo[j - 1] = value;
145145
carry = next_carry;
146146
}
147-
let (value, next_carry) = carrying_add(hi[i], carry, carry_top);
147+
let (value, next_carry) = carrying_add(hi_limb, carry, carry_top);
148148
lo[N - 1] = value;
149149
carry_top = next_carry;
150150
}

0 commit comments

Comments
 (0)