We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent abeeacb commit dd519a2Copy full SHA for dd519a2
src/math/lucas_series.rs
@@ -55,10 +55,10 @@ pub fn dynamic_lucas_number_logn(n: u32) -> u32 {
55
fn matrix_multiply(a: [[u32; 2]; 2], b: [[u32; 2]; 2]) -> [[u32; 2]; 2] {
56
let mut result = [[0u32; 2]; 2];
57
58
- for i in 0..2 {
+ for (i, a_row) in a.iter().enumerate() {
59
for j in 0..2 {
60
- for k in 0..2 {
61
- result[i][j] = result[i][j].wrapping_add(a[i][k].wrapping_mul(b[k][j]));
+ for (k, &a_ik) in a_row.iter().enumerate() {
+ result[i][j] = result[i][j].wrapping_add(a_ik.wrapping_mul(b[k][j]));
62
}
63
64
0 commit comments