Remove unneeded bitshift

This commit is contained in:
kageru 2021-12-16 23:12:44 +01:00
parent 07539273dc
commit b13bb26752
Signed by: kageru
GPG Key ID: 8282A2BEA4ADA3D2

View File

@ -14,7 +14,7 @@ fn bit_at(x: usize, n: usize) -> bool {
}
fn most_common(parsed: &Parsed, bits: usize) -> usize {
(0..bits).rev().map(|n| most_common_at(parsed, n)).fold(0, |acc, b| (acc | (b as usize)) << 1) >> 1
(0..bits).rev().map(|n| most_common_at(parsed, n)).fold(0, |acc, b| (acc << 1) | (b as usize))
}
fn most_common_at(parsed: &Parsed, n: usize) -> bool {