Skip to content

Commit

Permalink
Use physical equality for root checking
Browse files Browse the repository at this point in the history
Suggested-by: ArthurW <[email protected]>
  • Loading branch information
voodoos committed Dec 20, 2024
1 parent 3389ccb commit 7e10b7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index-format/union_find.ml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let rec find x =
| Root _ -> x
| Link ({ parent; _ } as link) ->
let root = find parent in
if root <> parent then link.parent <- root;
if root != parent then link.parent <- root;
root

let union ~f x y =
Expand Down

0 comments on commit 7e10b7e

Please sign in to comment.