From 4bed4a8563a0574e6b0a89628f178d453b40ccf4 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Sun, 22 Dec 2024 16:57:19 +0000 Subject: [PATCH] rename sequences to cache --- day-22/internal/two/solve.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/day-22/internal/two/solve.go b/day-22/internal/two/solve.go index 829b09a..a7da9d5 100644 --- a/day-22/internal/two/solve.go +++ b/day-22/internal/two/solve.go @@ -19,7 +19,7 @@ func Solve(buf []byte) (int, error) { conc := len(secrets) done := make(chan bool) - sequences := newSequenceCache() + cache := newSequenceCache() for _, secret := range secrets { go func() { seen := make(map[sequence]struct{}) @@ -35,7 +35,7 @@ func Solve(buf []byte) (int, error) { _, ok := seen[sequence] if !ok { seen[sequence] = struct{}{} - sequences.upsert(sequence, lastDigit(randomiser.Secret())) + cache.upsert(sequence, lastDigit(randomiser.Secret())) } } done <- true @@ -47,7 +47,7 @@ func Solve(buf []byte) (int, error) { } max := 0 - for _, sum := range sequences.data { + for _, sum := range cache.data { if sum > max { max = sum }