Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
starkda committed Apr 2, 2024
1 parent b4cf48b commit debef9d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/jpeek/calculus/java/Ccm.java
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,10 @@ private static Integer runUnionFind(final Map<String, String> parents,
*/
private static String getParent(final String node, final Map<String, String> parents) {
String ancestor = node;
while (!parents.get(ancestor).equals(ancestor)) {
ancestor = parents.get(ancestor);
if (!parents.get(ancestor).equals(ancestor)) {
ancestor = getParent(parents.get(ancestor), parents);
parents.put(node, ancestor);
}
parents.put(node, ancestor);
return ancestor;
}

Expand Down

0 comments on commit debef9d

Please sign in to comment.