@@ -2361,7 +2361,7 @@ impl Compiler<'_> {
23612361 // self.jump_to_fail_pop(pc, JumpOp::PopJumpIfFalse)?;
23622362 // }
23632363
2364- // // Check that the number of subpatterns is not absurd.
2364+ // // Check that the number of sub-patterns is not absurd.
23652365 // if size.saturating_sub(1) > (i32::MAX as usize) {
23662366 // panic!("too many sub-patterns in mapping pattern");
23672367 // // return self.compiler_error("too many sub-patterns in mapping pattern");
@@ -2469,41 +2469,41 @@ impl Compiler<'_> {
24692469 emit ! ( self , Instruction :: CopyItem { index: 1_u32 } ) ;
24702470 self . compile_pattern ( alt, pc) ?;
24712471
2472- let nstores = pc. stores . len ( ) ;
2472+ let n_stores = pc. stores . len ( ) ;
24732473 if i == 0 {
24742474 // Save the captured names from the first alternative.
24752475 control = Some ( pc. stores . clone ( ) ) ;
24762476 } else {
24772477 let control_vec = control. as_ref ( ) . unwrap ( ) ;
2478- if nstores != control_vec. len ( ) {
2478+ if n_stores != control_vec. len ( ) {
24792479 return Err ( self . error ( CodegenErrorType :: ConflictingNameBindPattern ) ) ;
2480- } else if nstores > 0 {
2480+ } else if n_stores > 0 {
24812481 // Check that the names occur in the same order.
2482- for icontrol in ( 0 ..nstores ) . rev ( ) {
2483- let name = & control_vec[ icontrol ] ;
2482+ for i_control in ( 0 ..n_stores ) . rev ( ) {
2483+ let name = & control_vec[ i_control ] ;
24842484 // Find the index of `name` in the current stores.
2485- let istores =
2485+ let i_stores =
24862486 pc. stores . iter ( ) . position ( |n| n == name) . ok_or_else ( || {
24872487 self . error ( CodegenErrorType :: ConflictingNameBindPattern )
24882488 } ) ?;
2489- if icontrol != istores {
2489+ if i_control != i_stores {
24902490 // The orders differ; we must reorder.
2491- assert ! ( istores < icontrol , "expected istores < icontrol " ) ;
2492- let rotations = istores + 1 ;
2491+ assert ! ( i_stores < i_control , "expected i_stores < i_control " ) ;
2492+ let rotations = i_stores + 1 ;
24932493 // Rotate pc.stores: take a slice of the first `rotations` items...
24942494 let rotated = pc. stores [ 0 ..rotations] . to_vec ( ) ;
24952495 // Remove those elements.
24962496 for _ in 0 ..rotations {
24972497 pc. stores . remove ( 0 ) ;
24982498 }
24992499 // Insert the rotated slice at the appropriate index.
2500- let insert_pos = icontrol - istores ;
2500+ let insert_pos = i_control - i_stores ;
25012501 for ( j, elem) in rotated. into_iter ( ) . enumerate ( ) {
25022502 pc. stores . insert ( insert_pos + j, elem) ;
25032503 }
25042504 // Also perform the same rotation on the evaluation stack.
2505- for _ in 0 ..( istores + 1 ) {
2506- self . pattern_helper_rotate ( icontrol + 1 ) ?;
2505+ for _ in 0 ..( i_stores + 1 ) {
2506+ self . pattern_helper_rotate ( i_control + 1 ) ?;
25072507 }
25082508 }
25092509 }
0 commit comments