Skip to content

Commit

Permalink
Heap#consolidate: Use compare_fn instead of #==
Browse files Browse the repository at this point in the history
Fix #23.
  • Loading branch information
bcc32 committed Dec 30, 2023
1 parent d8834b2 commit 9bb0b6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/containers/heap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def consolidate
degree += 1
end
degrees[degree] = root
min = root if min.key == root.key # this fixes a bug with duplicate keys not being in the right order
min = root if !@compare_fn[min.key, root.key] # this fixes a bug with duplicate keys not being in the right order
end
end
@next = min
Expand Down

0 comments on commit 9bb0b6c

Please sign in to comment.