mirror of
https://github.com/onyx-and-iris/aoc2024.git
synced 2025-01-08 13:50:48 +00:00
don't pass wg to next
This commit is contained in:
parent
ef120d05d4
commit
1f033ea3a0
@ -39,7 +39,7 @@ func Solve(buf []byte) (string, error) {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
next([]string{}, nodes, set.New(), cliquesChan, networks, &wg)
|
||||
next([]string{}, nodes, set.New(), cliquesChan, networks)
|
||||
}()
|
||||
|
||||
go func() {
|
||||
@ -65,7 +65,6 @@ func next(
|
||||
P, X *set.Set,
|
||||
cliquesChan chan<- clique,
|
||||
networks map[string]*set.Set,
|
||||
wg *sync.WaitGroup,
|
||||
) {
|
||||
if P.Size() == 0 && X.Size() == 0 {
|
||||
cliquesChan <- clique{slices.Clone(R)}
|
||||
@ -75,7 +74,7 @@ func next(
|
||||
for _, v := range P.List() {
|
||||
nextR := append(R, v)
|
||||
|
||||
next(nextR, P.Intersection(networks[v]), X.Intersection(networks[v]), cliquesChan, networks, wg)
|
||||
next(nextR, P.Intersection(networks[v]), X.Intersection(networks[v]), cliquesChan, networks)
|
||||
|
||||
P.Remove(v)
|
||||
X.Add(v)
|
||||
|
Loading…
Reference in New Issue
Block a user