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 }