Skip to content

Commit

Permalink
Fix perf issue
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Apr 20, 2023
1 parent a25420b commit 06b0fcf
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions crates/swc_ecma_minifier/src/compress/optimize/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2135,11 +2135,8 @@ where

n.params.visit_mut_with(optimizer);
if let Some(body) = n.body.as_mut() {
// Bypass visit_mut_stmts
for s in &mut body.stmts {
s.visit_mut_with(optimizer);
}
optimizer.handle_stmts(&mut body.stmts, true);
// Bypass block scope handler.
body.visit_mut_children_with(optimizer);
#[cfg(debug_assertions)]
{
body.visit_with(&mut AssertValid);
Expand Down

0 comments on commit 06b0fcf

Please sign in to comment.