]> git.donarmstrong.com Git - perltidy.git/commitdiff
simplification
authorSteve Hancock <perltidy@users.sourceforge.net>
Thu, 15 Sep 2022 04:30:55 +0000 (21:30 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Thu, 15 Sep 2022 04:30:55 +0000 (21:30 -0700)
lib/Perl/Tidy/Formatter.pm

index 9916dd1dd6549d2a5b5c79b65f1849a5cabbe508..6c82ede75937164b17e95952f0bcbc51b0e2a495 100644 (file)
@@ -8598,11 +8598,9 @@ sub find_nested_pairs {
             my $Kdiff = $K_signature_closing - $K_io_check;
             next if ( $Kdiff > 4 );
 
-            my $saw_comma;
-            foreach my $KK ( $K_io_check + 1 .. $K_signature_closing - 1 ) {
-                if ( $rLL->[$KK]->[_TYPE_] eq ',' ) { $saw_comma = 1; last }
-            }
-            next if ($saw_comma);
+            # backup comma count test; but we cannot get here with Kdiff<=4
+            my $rtc = $self->[_rtype_count_by_seqno_]->{$seqno_signature};
+            next if ( $rtc && $rtc->{','} );
         }
 
         # Yes .. this is a possible nesting pair.