From c4107138db7230a003f2680ee8b4faeb57a69a8a Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Tue, 14 Dec 2021 14:09:43 -0600 Subject: [PATCH] cleanup day 14 solution --- tests/aoc-2021/day14.onyx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/aoc-2021/day14.onyx b/tests/aoc-2021/day14.onyx index 088ba4b3..9c49986a 100644 --- a/tests/aoc-2021/day14.onyx +++ b/tests/aoc-2021/day14.onyx @@ -82,11 +82,7 @@ main :: (args) => { mode: Map(u8, u64); for^ polymer_state.entries { - if !mode->has(it.key.b) { - mode[it.key.b] = it.value.now; - } else { - mode[it.key.b] = mode[it.key.b] + it.value.now; - } + mode[it.key.b] = mode[it.key.b] + it.value.now; } maximum := array.fold(mode.entries, cast(u64) 0, (x, y) => math.max(x.value, y)); -- 2.25.1