don't need the top-level waitgroup
This commit is contained in:
parent
c2a087abf7
commit
137cfd379b
16
12/main.go
16
12/main.go
@ -108,13 +108,7 @@ func partOne() {
|
||||
rooms[p[1]] = b
|
||||
}
|
||||
successes := make(chan bool, 10000)
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
descend(rooms, "start", []string{}, successes, false)
|
||||
}()
|
||||
wg.Wait()
|
||||
descend(rooms, "start", []string{}, successes, false)
|
||||
fmt.Printf("%+v\n", len(successes))
|
||||
}
|
||||
func partTwo() {
|
||||
@ -140,12 +134,6 @@ func partTwo() {
|
||||
rooms[p[1]] = b
|
||||
}
|
||||
successes := make(chan bool, 200000)
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
descend(rooms, "start", []string{}, successes, true)
|
||||
}()
|
||||
wg.Wait()
|
||||
descend(rooms, "start", []string{}, successes, true)
|
||||
fmt.Printf("%+v\n", len(successes))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user