Skip to content

Commit 183bb53

Browse files
resolve clippy warning for needless range loop
1 parent 17a57ba commit 183bb53

File tree

1 file changed

+3
-3
lines changed
  • kupyna/src/sub_units/t_xor_plus

1 file changed

+3
-3
lines changed

kupyna/src/sub_units/t_xor_plus/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ pub(crate) fn add_constant_xor(mut state: Matrix, round: usize, hash_params: &Ku
4848

4949
pub(crate) fn add_constant_plus(mut state: Matrix, round: usize, hash_params: &KupynaH) -> Matrix {
5050
let rows = hash_params.state_matrix_rows;
51-
for j in 0..rows {
52-
let mut row_as_u64 = u64::from_le_bytes(state[j][0..8].try_into().unwrap());
51+
for (j, row) in state.iter_mut().enumerate().take(rows) {
52+
let mut row_as_u64 = u64::from_le_bytes(row[0..8].try_into().unwrap());
5353
row_as_u64 = row_as_u64.wrapping_add(
5454
0x00F0F0F0F0F0F0F3u64 ^ (((((rows - j - 1) * 0x10) ^ round) as u64) << 56),
5555
);
56-
state[j][0..8].copy_from_slice(&row_as_u64.to_le_bytes());
56+
row[0..8].copy_from_slice(&row_as_u64.to_le_bytes());
5757
}
5858
state
5959
}

0 commit comments

Comments
 (0)