Commit 14a16b81 authored by Etienne Renault's avatar Etienne Renault

bloemen: avoid tail-recursive calls

* spot/mc/bloemen.hh: here.
parent f40e6efc
......@@ -161,15 +161,16 @@ namespace spot
bool sameset(uf_element* a, uf_element* b)
{
uf_element* a_root = find(a);
uf_element* b_root = find(b);
if (a_root == b_root)
return true;
if (a_root->parent.load() == a_root)
return false;
while (true)
{
uf_element* a_root = find(a);
uf_element* b_root = find(b);
if (a_root == b_root)
return true;
return sameset(a_root, b_root);
if (a_root->parent.load() == a_root)
return false;
}
}
bool lock_root(uf_element* a)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment