chore: minor optimization at mkFlatLet
This commit is contained in:
parent
776a9b0dcb
commit
b2a99e1b68
1 changed files with 5 additions and 1 deletions
|
|
@ -276,7 +276,11 @@ Remark: `body` may have many loose bound variables, and the loose bound variable
|
|||
must be lifted by `n`.
|
||||
-/
|
||||
private def mkFlatLet (y : Name) (type : Expr) (value : Expr) (body : Expr) (nonDep : Bool := false) : Expr :=
|
||||
go value 0
|
||||
match value with
|
||||
| .letE binderName type value'@(.lam ..) (.bvar 0) nonDep =>
|
||||
/- Easy case that is often generated by `inlineProjInst?` -/
|
||||
.letE binderName type value' body nonDep
|
||||
| _ => go value 0
|
||||
where
|
||||
go (value : Expr) (i : Nat) : Expr :=
|
||||
match value with
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue