chore: replace partially redundant calls to FnBody.split with .body (#9568)
This commit is contained in:
parent
af84f76f31
commit
2be6c75c2b
3 changed files with 3 additions and 6 deletions
|
|
@ -78,8 +78,7 @@ partial def visitFnBody (fnid : FunId) : FnBody → StateM ParamMap Unit
|
|||
| FnBody.case _ _ _ alts => alts.forM fun alt => visitFnBody fnid alt.body
|
||||
| e => do
|
||||
unless e.isTerminal do
|
||||
let (_, b) := e.split
|
||||
visitFnBody fnid b
|
||||
visitFnBody fnid e.body
|
||||
|
||||
def visitDecls (env : Environment) (decls : Array Decl) : StateM ParamMap Unit :=
|
||||
decls.forM fun decl => match decl with
|
||||
|
|
|
|||
|
|
@ -216,8 +216,7 @@ partial def collectResets (e : FnBody) : N Unit := do
|
|||
| .jdecl _ _ v b => collectResets v; collectResets b
|
||||
| .vdecl _ _ (.reset _ x) b => modify fun s => s.insert x; collectResets b
|
||||
| e => unless e.isTerminal do
|
||||
let (_, b) := e.split
|
||||
collectResets b
|
||||
collectResets e.body
|
||||
|
||||
end ResetReuse
|
||||
open ResetReuse
|
||||
|
|
|
|||
|
|
@ -45,8 +45,7 @@ partial def visitFnBody (b : FnBody) : ExceptT Name M Unit := do
|
|||
| .case _ _ _ alts => alts.forM fun alt => visitFnBody alt.body
|
||||
| _ =>
|
||||
unless b.isTerminal do
|
||||
let (_, b) := b.split
|
||||
visitFnBody b
|
||||
visitFnBody b.body
|
||||
|
||||
def visitDecl (d : Decl) : M Unit := do
|
||||
match d with
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue