mirror of
https://github.com/onyx-and-iris/aoc2024.git
synced 2025-01-09 06:10:47 +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)
|
wg.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
next([]string{}, nodes, set.New(), cliquesChan, networks, &wg)
|
next([]string{}, nodes, set.New(), cliquesChan, networks)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
@ -65,7 +65,6 @@ func next(
|
|||||||
P, X *set.Set,
|
P, X *set.Set,
|
||||||
cliquesChan chan<- clique,
|
cliquesChan chan<- clique,
|
||||||
networks map[string]*set.Set,
|
networks map[string]*set.Set,
|
||||||
wg *sync.WaitGroup,
|
|
||||||
) {
|
) {
|
||||||
if P.Size() == 0 && X.Size() == 0 {
|
if P.Size() == 0 && X.Size() == 0 {
|
||||||
cliquesChan <- clique{slices.Clone(R)}
|
cliquesChan <- clique{slices.Clone(R)}
|
||||||
@ -75,7 +74,7 @@ func next(
|
|||||||
for _, v := range P.List() {
|
for _, v := range P.List() {
|
||||||
nextR := append(R, v)
|
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)
|
P.Remove(v)
|
||||||
X.Add(v)
|
X.Add(v)
|
||||||
|
Loading…
Reference in New Issue
Block a user