Skip to content

Commit

Permalink
flambda-backend: Inline a variable to save 2%+ in allocations (#1353)
Browse files Browse the repository at this point in the history
  • Loading branch information
goldfirere authored May 4, 2023
1 parent 96f8f00 commit a24d2ec
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions typing/layouts.ml
Original file line number Diff line number Diff line change
Expand Up @@ -575,8 +575,9 @@ end

let sub sub super =
let ok = Ok () in
let err = Error (Violation.not_a_sublayout sub super) in
let equality_check is_eq = if is_eq then ok else err in
let equality_check is_eq = if is_eq then ok
else Error (Violation.not_a_sublayout sub super)
in
match get sub, get super with
| _, Const Any -> ok
| Const c1, Const c2 when equal_const c1 c2 -> ok
Expand Down

0 comments on commit a24d2ec

Please sign in to comment.