mirror of
https://github.com/onyx-and-iris/aoc2024.git
synced 2025-01-08 13:50:48 +00:00
rename sequences to cache
This commit is contained in:
parent
287a168293
commit
4bed4a8563
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user