Remove size parameter from dsf init and copy functions.

Now that the dsf knows its own size internally, there's no need to
tell it again when one is copied or reinitialised.

This makes dsf_init much more about *re*initialising a dsf, since now
dsfs are always allocated using a function that will initialise them
anyway. So I think it deserves a rename.
This commit is contained in:
Simon Tatham
2023-04-20 14:46:46 +01:00
parent dad2f35502
commit 348aac4c85
15 changed files with 37 additions and 35 deletions

View File

@ -472,13 +472,13 @@ static int slant_solve(int w, int h, const signed char *clues,
* Establish a disjoint set forest for tracking connectedness
* between grid points.
*/
dsf_init(sc->connected, W*H);
dsf_reinit(sc->connected);
/*
* Establish a disjoint set forest for tracking which squares
* are known to slant in the same direction.
*/
dsf_init(sc->equiv, w*h);
dsf_reinit(sc->equiv);
/*
* Clear the slashval array.