mirror of
https://github.com/uutils/coreutils
synced 2024-07-21 18:04:45 +00:00
refactor/cksum ~ polish spelling (comments, names, and exceptions)
This commit is contained in:
parent
43f5c13a7f
commit
fc5451b5e7
|
@ -99,15 +99,15 @@ const fn crc_entry(input: u8) -> u32 {
|
|||
// i += 1;
|
||||
//}
|
||||
unroll!(8, |_i| {
|
||||
let if_cond = crc & 0x8000_0000;
|
||||
let if_condition = crc & 0x8000_0000;
|
||||
let if_body = (crc << 1) ^ 0x04c1_1db7;
|
||||
let else_body = crc << 1;
|
||||
|
||||
// NOTE: i feel like this is easier to understand than emulating an if statement in bitwise
|
||||
// ops
|
||||
let cond_table = [else_body, if_body];
|
||||
let condition_table = [else_body, if_body];
|
||||
|
||||
crc = cond_table[(if_cond != 0) as usize];
|
||||
crc = condition_table[(if_condition != 0) as usize];
|
||||
});
|
||||
|
||||
crc
|
||||
|
|
Loading…
Reference in a new issue