From 762e5bcef3e6a556992bf8abca3e1327657cae0c Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Fri, 4 Dec 2020 21:19:51 -0800 Subject: [PATCH] Reduced readability in the name of cool factor :sunglasses: --- 2020/day5.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/2020/day5.cpp b/2020/day5.cpp index 04d1606..70d3d35 100644 --- a/2020/day5.cpp +++ b/2020/day5.cpp @@ -42,10 +42,7 @@ auto main(i32 argc, char * argv[]) -> i32 { while (getline(file, line)) { auto local_seat = usize(0); for (auto i = usize(0); i < 7 + 3; ++i) { - local_seat <<= 1; - if (line[i] == 'B' || line[i] == 'R') { - local_seat |= 1; - } + local_seat = (local_seat << 1) | (line[i] == 'B' || line[i] == 'R'); } if (local_seat > seat) { seat = local_seat;