Skip to content

Commit a24d2ec

Browse files
authored
flambda-backend: Inline a variable to save 2%+ in allocations (#1353)
1 parent 96f8f00 commit a24d2ec

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

typing/layouts.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,8 +575,9 @@ end
575575

576576
let sub sub super =
577577
let ok = Ok () in
578-
let err = Error (Violation.not_a_sublayout sub super) in
579-
let equality_check is_eq = if is_eq then ok else err in
578+
let equality_check is_eq = if is_eq then ok
579+
else Error (Violation.not_a_sublayout sub super)
580+
in
580581
match get sub, get super with
581582
| _, Const Any -> ok
582583
| Const c1, Const c2 when equal_const c1 c2 -> ok

0 commit comments

Comments
 (0)