Skip to content

Commit e492e89

Browse files
committed
small tweak to avoid double not
1 parent 6f5f968 commit e492e89

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

jscomp/core/lam.ml

+5-1
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,11 @@ let prim ~primitive:(prim : Lam_primitive.t) ~args loc : t =
676676
default ()
677677

678678
let not_ loc x : t =
679-
prim ~primitive:Pnot ~args:[x] loc
679+
match x with
680+
| Lprim ({primitive = Pintcomp Cneq } as prim)->
681+
Lprim {prim with primitive = Pintcomp Ceq}
682+
| _ ->
683+
prim ~primitive:Pnot ~args:[x] loc
680684

681685

682686
let has_boolean_type (x : t) =

0 commit comments

Comments
 (0)