removed unused coding
authorSteve Hancock <perltidy@users.sourceforge.net>
Mon, 29 Aug 2022 01:52:07 +0000 (18:52 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Mon, 29 Aug 2022 01:52:07 +0000 (18:52 -0700)
lib/Perl/Tidy/Tokenizer.pm

index f065cc693b7c310c016381a95e1db15b7db32560..e6e26158fe0b2762c3c8475c57a4d92b6d9fcbf6 100644 (file)
@@ -4856,7 +4856,7 @@ EOM
         }
 
         # Remember last nonblank values
-        unless ( ( $type eq 'b' ) || ( $type eq '#' ) ) {
+        if ( $type ne 'b' && $type ne '#' ) {
             $last_last_nonblank_token          = $last_nonblank_token;
             $last_last_nonblank_type           = $last_nonblank_type;
             $last_last_nonblank_block_type     = $last_nonblank_block_type;
@@ -5011,7 +5011,6 @@ EOM
         my @tokens        = ();    # output tokens
         my @levels        = ();    # structural brace levels of output tokens
         my @ci_string = ();  # string needed to compute continuation indentation
-        my $container_environment = EMPTY_STRING;
 
         # Count the number of '1's in the string (previously sub ones_count)
         my $ci_string_sum = ( my $str = $ci_string_in_tokenizer ) =~ tr/1/0/;
@@ -5071,12 +5070,6 @@ EOM
                     || $ternary_indentation_flag > 0 )
                 {
 
-                    # use environment before updating
-                    $container_environment =
-                        $nesting_block_flag ? 'BLOCK'
-                      : $nesting_list_flag  ? 'LIST'
-                      :                       EMPTY_STRING;
-
                     # if the difference between total nesting levels is not 1,
                     # there are intervening non-structural nesting types between
                     # this '{' and the previous unclosed '{'
@@ -5280,11 +5273,6 @@ EOM
                         }
                     } ## end if ( length($nesting_block_string...))
 
-                    # use environment after updating
-                    $container_environment =
-                        $nesting_block_flag ? 'BLOCK'
-                      : $nesting_list_flag  ? 'LIST'
-                      :                       EMPTY_STRING;
                     $ci_string_i = $ci_string_sum + $in_statement_continuation;
                 } ## end elsif ( $type_i eq '}' ||...{)
 
@@ -5293,11 +5281,6 @@ EOM
                 #-----------------------------------------
                 else {
 
-                    $container_environment =
-                        $nesting_block_flag ? 'BLOCK'
-                      : $nesting_list_flag  ? 'LIST'
-                      :                       EMPTY_STRING;
-
                     # zero the continuation indentation at certain tokens so
                     # that they will be at the same level as its container.  For
                     # commas, this simplifies the -lp indentation logic, which
@@ -5311,7 +5294,7 @@ EOM
 
                     # be sure binary operators get continuation indentation
                     if (
-                        $container_environment
+                        ( $nesting_block_flag || $nesting_list_flag )
                         && (   $type_i eq 'k' && $is_binary_keyword{$tok_i}
                             || $is_binary_type{$type_i} )
                       )