projects
/
onyx.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b0e7d79
)
cleanup day 14 solution
author
Brendan Hansen
<brendan.f.hansen@gmail.com>
Tue, 14 Dec 2021 20:09:43 +0000
(14:09 -0600)
committer
Brendan Hansen
<brendan.f.hansen@gmail.com>
Tue, 14 Dec 2021 20:09:43 +0000
(14:09 -0600)
tests/aoc-2021/day14.onyx
patch
|
blob
|
history
diff --git
a/tests/aoc-2021/day14.onyx
b/tests/aoc-2021/day14.onyx
index 088ba4b349ddc5596172a924864763cbfd3f5056..9c49986a26e48720c0cbe4f0715226960ac550ed 100644
(file)
--- 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));