Skip to content

Commit a8b1f3d

Browse files
committed
Generate simpler code for comparisons
The ocaml compiler (without flambda) does not optimize `Int.compare x y = 1` into a plain comparison.
1 parent 5067176 commit a8b1f3d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/import.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ end
1111

1212
let ( = ) = Int.equal
1313
let ( == ) = [ `Use_phys_equal ]
14-
let ( < ) x y = Int.compare x y = -1
15-
let ( > ) x y = Int.compare x y = 1
14+
let ( < ) (x : int) (y : int) = x < y
15+
let ( > ) (x : int) (y : int) = x > y
1616
let min = Int.min
1717
let max = Int.max
1818
let compare = Int.compare

0 commit comments

Comments
 (0)