aboutsummaryrefslogtreecommitdiff
path: root/divvy.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2023-04-20 15:32:10 +0100
committerSimon Tatham <anakin@pobox.com>2023-04-20 18:39:35 +0100
commit14e1e05510ac02a5502823bafe46d98c6fab3e5c (patch)
treed7e99ac9bb574bc62a324cf3bb435b485c1113b3 /divvy.c
parent088fdeee38599b1711ba8766d36c652f1355e36e (diff)
downloadpuzzles-14e1e05510ac02a5502823bafe46d98c6fab3e5c.zip
puzzles-14e1e05510ac02a5502823bafe46d98c6fab3e5c.tar.gz
puzzles-14e1e05510ac02a5502823bafe46d98c6fab3e5c.tar.bz2
puzzles-14e1e05510ac02a5502823bafe46d98c6fab3e5c.tar.xz
Introduce a new dsf_equivalent() function.
Not very interesting, but the idiom for checking equivalence via two calls to dsf_canonify is cumbersome enough to be worth abbreviating.
Diffstat (limited to 'divvy.c')
-rw-r--r--divvy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/divvy.c b/divvy.c
index 6e22cd8..92b159a 100644
--- a/divvy.c
+++ b/divvy.c
@@ -632,7 +632,7 @@ DSF *divvy_rectangle_attempt(int w, int h, int k, random_state *rs)
dsf_merge(tmpdsf, y*w+x, (y+1)*w+x);
for (i = 0; i < wh; i++) {
j = dsf_canonify(retdsf, i);
- assert(dsf_canonify(tmpdsf, j) == dsf_canonify(tmpdsf, i));
+ assert(dsf_equivalent(tmpdsf, j, i));
}
cleanup: