remove unnecessary number suffixes

This commit is contained in:
Vukašin Stepanović
2023-02-17 16:12:23 +00:00
parent 01e4f4a126
commit c77f0af6f6
21 changed files with 46 additions and 58 deletions

View File

@@ -136,7 +136,7 @@ fn getBit(bit: u8, bytes: &[u8]) -> u8 {
}
fn getInt(bytes: &[u8], x: &[u8]) -> u32 {
let mut val = 0u32;
let mut val: u32 = 0;
for i in 0..x.len() {
// for (int i = 0; i < x.length; i++) {
val += (getBit(x[i], bytes) as u32) << ((x.len() - i - 1) as u32);

View File

@@ -95,7 +95,7 @@ fn correctErrors(
let divisor = if mode == ALL { 1 } else { 2 };
// First read into an array of ints
let mut codewordsInts = vec![0i32; (codewords / divisor) as usize];
let mut codewordsInts = vec![0; (codewords / divisor) as usize];
for i in 0..codewords {
if (mode == ALL) || (i % 2 == (mode - 1)) {
codewordsInts[(i / divisor) as usize] = codewordBytes[(i + start) as usize] as i32;