From 91c183412cae55be2ddf5368ae35367ef9420ded Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Wed, 14 Sep 2022 21:30:55 -0700 Subject: [PATCH] simplification --- lib/Perl/Tidy/Formatter.pm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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. -- 2.39.5