Remove useless optimizations caught just after

This commit is contained in:
Denis Merigoux 2023-12-19 17:26:36 +01:00
parent 9d9a2c4496
commit af16be501a
No known key found for this signature in database
GPG Key ID: EE99DCFA365C3EE3

View File

@ -206,12 +206,6 @@ let rec optimize_expr :
cases1 cases2
in
EMatch { e = arg; cases; name = n1 }
| EApp { f = EAbs { binder; _ }, _; args = [(ELit _, _)] as args } ->
(* beta reduction when let-binding a literal *)
Mark.remove (Bindlib.msubst binder (List.map fst args |> Array.of_list))
| EApp { f = EAbs { binder; _ }, _; args = [(EVar _, _)] as args } ->
(* beta reduction when let-binding a variable *)
Mark.remove (Bindlib.msubst binder (List.map fst args |> Array.of_list))
| EApp { f = EAbs { binder; _ }, _; args }
when binder_vars_used_at_most_once binder
(* when variables not used *)