Remove a direct use of dsf internals in Filling.

The expression 'dsf[foo] >> 2' already has a sensible wrapper
function, but Filling wasn't bothering to call it.
This commit is contained in:
Simon Tatham
2023-04-20 14:00:23 +01:00
parent f21c7d2766
commit 7abf85a9c6

View File

@ -559,7 +559,7 @@ static int expandsize(const int *board, int *dsf, int w, int h, int i, int n) {
root = dsf_canonify(dsf, idx); root = dsf_canonify(dsf, idx);
for (m = 0; m < nhits && root != hits[m]; ++m); for (m = 0; m < nhits && root != hits[m]; ++m);
if (m < nhits) continue; if (m < nhits) continue;
printv("\t (%d, %d) contrib %d to size\n", x, y, dsf[root] >> 2); printv("\t (%d, %d) contrib %d to size\n", x, y, dsf_size(dsf, root));
size += dsf_size(dsf, root); size += dsf_size(dsf, root);
assert(dsf_size(dsf, root) >= 1); assert(dsf_size(dsf, root) >= 1);
hits[nhits++] = root; hits[nhits++] = root;