From 9f07cd5e71907bc72024455a80c14c7d118cf645 Mon Sep 17 00:00:00 2001 From: birds3345 <31601136+birds3345@users.noreply.github.com> Date: Wed, 17 Jul 2024 13:40:23 -0400 Subject: [PATCH] use correct variables --- EqSat/src/UnionFind.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EqSat/src/UnionFind.cpp b/EqSat/src/UnionFind.cpp index 7b1cb670..536de271 100644 --- a/EqSat/src/UnionFind.cpp +++ b/EqSat/src/UnionFind.cpp @@ -48,9 +48,9 @@ void UnionFind::merge(Id a, Id b) // Ensure that the rank of set A is greater than the rank of set B if (ranks[size_t(aSet)] < ranks[size_t(bSet)]) - std::swap(a, b); + std::swap(aSet, bSet); - parents[size_t(b)] = a; + parents[size_t(bSet)] = aSet; if (ranks[size_t(aSet)] == ranks[size_t(bSet)]) ranks[size_t(aSet)]++;