mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-20 23:51:29 -07:00
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.
This commit is contained in:
5
dsf.c
5
dsf.c
@ -58,6 +58,11 @@ int dsf_canonify(DSF *dsf, int index)
|
||||
return edsf_canonify(dsf, index, NULL);
|
||||
}
|
||||
|
||||
bool dsf_equivalent(DSF *dsf, int i1, int i2)
|
||||
{
|
||||
return edsf_canonify(dsf, i1, NULL) == edsf_canonify(dsf, i2, NULL);
|
||||
}
|
||||
|
||||
void dsf_merge(DSF *dsf, int v1, int v2)
|
||||
{
|
||||
edsf_merge(dsf, v1, v2, false);
|
||||
|
Reference in New Issue
Block a user