From: Steve Hancock Date: Thu, 15 Sep 2022 04:30:55 +0000 (-0700) Subject: simplification X-Git-Tag: 20220613.05~2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=91c183412cae55be2ddf5368ae35367ef9420ded;p=perltidy.git simplification --- diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 9916dd1d..6c82ede7 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -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.