Skip to content

Commit

Permalink
Fix compare function (ocsigen#1729)
Browse files Browse the repository at this point in the history
  • Loading branch information
vouillon committed Nov 7, 2024
1 parent 56bb9e8 commit 9a0c0a3
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 9a0c0a3

Please sign in to comment.