Consistently use snew_dsf to allocate dsfs.

All remaining cases where a dsf was allocated via snewn(foo, int) are
removed by this change.
This commit is contained in:
Simon Tatham
2023-04-20 13:56:44 +01:00
parent 11a8149d67
commit f21c7d2766
8 changed files with 11 additions and 13 deletions

View File

@ -455,7 +455,7 @@ static solver_state *dup_solver_state(const solver_state *sstate) {
ret->solver_status = sstate->solver_status;
ret->diff = sstate->diff;
ret->dotdsf = snewn(num_dots, int);
ret->dotdsf = snew_dsf(num_dots);
ret->looplen = snewn(num_dots, int);
dsf_copy(ret->dotdsf, sstate->dotdsf, num_dots);
memcpy(ret->looplen, sstate->looplen,
@ -485,7 +485,7 @@ static solver_state *dup_solver_state(const solver_state *sstate) {
}
if (sstate->linedsf) {
ret->linedsf = snewn(num_edges, int);
ret->linedsf = snew_dsf(num_edges);
dsf_copy(ret->linedsf, sstate->linedsf, num_edges);
} else {
ret->linedsf = NULL;