chore: replace partially redundant calls to FnBody.split with .body (#9568)

This commit is contained in:
Cameron Zwarich 2025-07-26 13:18:37 -07:00 committed by GitHub
parent af84f76f31
commit 2be6c75c2b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 6 deletions

View file

@ -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

View file

@ -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

View file

@ -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