idiomatique change
This commit is contained in:
@ -11,14 +11,15 @@ impl TannerGraph {
|
|||||||
let mut check = vec![vec![]; matrix.rows];
|
let mut check = vec![vec![]; matrix.rows];
|
||||||
let mut bits = vec![vec![]; matrix.cols];
|
let mut bits = vec![vec![]; matrix.cols];
|
||||||
|
|
||||||
for i in 0..matrix.rows {
|
for (i, row_check) in check.iter_mut().enumerate() {
|
||||||
for j in 0..matrix.cols {
|
for (j, col_bits) in bits.iter_mut().enumerate() {
|
||||||
if matrix.get(i, j) == 0 {
|
if matrix.get(i, j) == 0 {
|
||||||
check[i].push(j);
|
row_check.push(j);
|
||||||
bits[j].push(i);
|
col_bits.push(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Self { check, bits }
|
Self { check, bits }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user