File tree Expand file tree Collapse file tree 2 files changed +12
-22
lines changed
Expand file tree Collapse file tree 2 files changed +12
-22
lines changed Original file line number Diff line number Diff line change @@ -7661,11 +7661,8 @@ impl Compiler {
76617661 // Async comprehensions are not inlined due to complex exception handling
76627662 let was_in_inlined_comp = self . current_code_info ( ) . in_inlined_comp ;
76637663 self . current_code_info ( ) . in_inlined_comp = true ;
7664- let result = self . compile_inlined_comprehension (
7665- init_collection,
7666- generators,
7667- compile_element,
7668- ) ;
7664+ let result =
7665+ self . compile_inlined_comprehension ( init_collection, generators, compile_element) ;
76697666 self . current_code_info ( ) . in_inlined_comp = was_in_inlined_comp;
76707667 return result;
76717668 }
@@ -7953,9 +7950,7 @@ impl Compiler {
79537950 compile_element ( self ) ?;
79547951
79557952 // Step 7: Close all loops (sync only - async comprehensions are never inlined)
7956- for ( loop_block, if_cleanup_block, after_block) in
7957- loop_labels. iter ( ) . rev ( ) . copied ( )
7958- {
7953+ for ( loop_block, if_cleanup_block, after_block) in loop_labels. iter ( ) . rev ( ) . copied ( ) {
79597954 emit ! ( self , PseudoInstruction :: Jump { delta: loop_block } ) ;
79607955
79617956 self . switch_to_block ( if_cleanup_block) ;
Original file line number Diff line number Diff line change @@ -2072,20 +2072,15 @@ impl SymbolTableBuilder {
20722072 // Note: tables.last() is the comprehension scope we just pushed,
20732073 // so we check the second-to-last for the parent scope.
20742074 if !is_generator {
2075- let parent_is_func = self
2076- . tables
2077- . iter ( )
2078- . rev ( )
2079- . nth ( 1 )
2080- . is_some_and ( |t| {
2081- matches ! (
2082- t. typ,
2083- CompilerScope :: Function
2084- | CompilerScope :: AsyncFunction
2085- | CompilerScope :: Lambda
2086- | CompilerScope :: Comprehension
2087- )
2088- } ) ;
2075+ let parent_is_func = self . tables . iter ( ) . rev ( ) . nth ( 1 ) . is_some_and ( |t| {
2076+ matches ! (
2077+ t. typ,
2078+ CompilerScope :: Function
2079+ | CompilerScope :: AsyncFunction
2080+ | CompilerScope :: Lambda
2081+ | CompilerScope :: Comprehension
2082+ )
2083+ } ) ;
20892084 if parent_is_func {
20902085 self . tables . last_mut ( ) . unwrap ( ) . comp_inlined = true ;
20912086 }
You can’t perform that action at this time.
0 commit comments