diff options
| author | Simon Tatham <anakin@pobox.com> | 2023-04-20 14:46:46 +0100 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2023-04-20 17:30:03 +0100 |
| commit | 348aac4c85da21e09c29c58866d178df3204d73c (patch) | |
| tree | eff802bf3ef3b5459bbe268e35328b1155cf3472 /filling.c | |
| parent | dad2f35502c611dae758915cfb6dface4a303550 (diff) | |
| download | puzzles-348aac4c85da21e09c29c58866d178df3204d73c.zip puzzles-348aac4c85da21e09c29c58866d178df3204d73c.tar.gz puzzles-348aac4c85da21e09c29c58866d178df3204d73c.tar.bz2 puzzles-348aac4c85da21e09c29c58866d178df3204d73c.tar.xz | |
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.
Diffstat (limited to 'filling.c')
| -rw-r--r-- | filling.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -411,7 +411,7 @@ static void make_board(int *board, int w, int h, random_state *rs) { dsf = snew_dsf(sz); retry: - dsf_init(dsf, sz); + dsf_reinit(dsf); shuffle(board, sz, sizeof (int), rs); do { @@ -946,7 +946,7 @@ static bool learn_bitmap_deductions(struct solver_state *s, int w, int h) * have a completely new n-region in it. */ for (n = 1; n <= 9; n++) { - dsf_init(dsf, sz); + dsf_reinit(dsf); /* Build the dsf */ for (y = 0; y < h; y++) @@ -1137,7 +1137,7 @@ static DSF *make_dsf(DSF *dsf, int *board, const int w, const int h) { if (!dsf) dsf = snew_dsf(w * h); else - dsf_init(dsf, w * h); + dsf_reinit(dsf); for (i = 0; i < sz; ++i) { int j; |