File tree Expand file tree Collapse file tree
crates/oxc_minifier/src/peephole Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ use super::PeepholeOptimizations;
99impl < ' a > PeepholeOptimizations {
1010 /// `mangleFor`: <https://github.com/evanw/esbuild/blob/v0.24.2/internal/js_ast/js_parser.go#L9801>
1111 pub fn minimize_for_statement ( for_stmt : & mut ForStatement < ' a > , ctx : & mut TraverseCtx < ' a > ) {
12- // Get the first statement in the loop
1312 let mut first = & for_stmt. body ;
1413 if let Statement :: BlockStatement ( block_stmt) = first {
1514 if let Some ( b) = block_stmt. body . first ( ) {
Original file line number Diff line number Diff line change @@ -247,7 +247,6 @@ impl<'a> PeepholeOptimizations {
247247 ArenaHashMap :: new_in ( ctx. allocator ( ) ) ;
248248 let mut merges = ArenaVec :: new_in ( ctx) ;
249249
250- // Collect the candidates
251250 for ( statement_index, stmt) in stmts. iter ( ) . enumerate ( ) {
252251 match stmt {
253252 Statement :: ImportDeclaration ( import_decl) => {
Original file line number Diff line number Diff line change @@ -272,7 +272,6 @@ impl<'a> PeepholeOptimizations {
272272 _ => { }
273273 } ,
274274 Some ( true ) => {
275- // Remove the test expression.
276275 if let Some ( old) = for_stmt. test . take ( ) {
277276 ctx. drop_expression ( & old) ;
278277 }
@@ -334,7 +333,6 @@ impl<'a> PeepholeOptimizations {
334333 // https://github.com/evanw/esbuild/commit/add452ed51333953dd38a26f28a775bb220ea2e9
335334 let case_count = switch_stmt. cases . len ( ) ;
336335 if case_count == 1 {
337- // Remove sole case if empty and has no side-effect test
338336 if Self :: is_switch_case_removable ( & switch_stmt. cases [ 0 ] , true ) {
339337 ctx. drop_switch_case ( & switch_stmt. cases . pop ( ) . unwrap ( ) ) ;
340338 }
You can’t perform that action at this time.
0 commit comments