From: Steve Hancock Date: Tue, 5 Jul 2022 00:58:23 +0000 (-0700) Subject: small optimization X-Git-Tag: 20220613.01~2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=fb2557ba79e4ea74769891ca9799072dbf687087;p=perltidy.git small optimization --- diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 3712de19..d59dacd8 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -3092,19 +3092,20 @@ sub set_whitespace_flags { $rwhitespace_flags->[$j] = $ws; - if (DEBUG_WHITE) { - my $str = substr( $last_token, 0, 15 ); - $str .= SPACE x ( 16 - length($str) ); - if ( !defined($ws_1) ) { $ws_1 = "*" } - if ( !defined($ws_2) ) { $ws_2 = "*" } - if ( !defined($ws_3) ) { $ws_3 = "*" } - if ( !defined($ws_4) ) { $ws_4 = "*" } - print STDOUT + next if ( !DEBUG_WHITE ); + + my $str = substr( $last_token, 0, 15 ); + $str .= SPACE x( 16 - length($str) ); + if ( !defined($ws_1) ) { $ws_1 = "*" } + if ( !defined($ws_2) ) { $ws_2 = "*" } + if ( !defined($ws_3) ) { $ws_3 = "*" } + if ( !defined($ws_4) ) { $ws_4 = "*" } + print STDOUT "NEW WHITE: i=$j $str $last_type $type $ws_1 : $ws_2 : $ws_3 : $ws_4 : $ws \n"; - # reset for next pass - $ws_1 = $ws_2 = $ws_3 = $ws_4 = undef; - } + # reset for next pass + $ws_1 = $ws_2 = $ws_3 = $ws_4 = undef; + } ## end main loop if ( $rOpts->{'tight-secret-operators'} ) {