diff --git a/src/day22.rs b/src/day22.rs index 44c8020..9a76837 100644 --- a/src/day22.rs +++ b/src/day22.rs @@ -46,13 +46,13 @@ unsafe fn inner1(input: &str) -> i64 { let mut nums = [0; 64]; while i < input.len() { - for j in 0..64 { + (0..64).for_each(|j| { if i < input.len() { *nums.get_unchecked_mut(j) = read_unsigned_skip!(input, i); } else { *nums.get_unchecked_mut(j) = 0; } - } + }); let mut nums = i64x64::from_slice(&nums); @@ -73,14 +73,14 @@ unsafe fn inner1(input: &str) -> i64 { }}; } - for _ in 0..2000 { + (0..2000).for_each(|_| { mix!(nums * _64); prune!(); mix!(nums / _32); prune!(); mix!(nums * _2048); prune!(); - } + }); result += nums.reduce_sum(); }