Skip to content

Commit

Permalink
Fix compare function (#1729)
Browse files Browse the repository at this point in the history
  • Loading branch information
vouillon authored Nov 6, 2024
1 parent 60526e6 commit e67805e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion runtime/js/compare.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function caml_compare_val_number_custom(num, custom, swap, total) {
if (comp) {
var x = swap > 0 ? comp(custom, num, total) : comp(num, custom, total);
if (total && Number.isNaN(x)) return swap; // total && nan
if (Number.isNan(+x)) return +x; // nan
if (Number.isNaN(+x)) return +x; // nan
if ((x | 0) !== 0) return x | 0; // !nan
}
return swap;
Expand Down

0 comments on commit e67805e

Please sign in to comment.