]> git.donarmstrong.com Git - perltidy.git/commitdiff
remove unused code for alternating iteration directions
authorSteve Hancock <perltidy@users.sourceforge.net>
Fri, 13 Jan 2023 20:40:46 +0000 (12:40 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Fri, 13 Jan 2023 20:40:46 +0000 (12:40 -0800)
This worked okay but I deactivated it some time ago because there is a danger
that it could cause formatting instability (oscillating states).

lib/Perl/Tidy/Formatter.pm

index 8d5292a86eed30aecb290cbcdb17c916c3946e08..f33813aebc1cef8760d3e7b4843f0722e0934a35 100644 (file)
@@ -18131,7 +18131,6 @@ sub break_equals {
         # We keep looping over all of the lines of this batch
         # until there are no more possible recombinations
         my $nmax_last = $nmax_sec + 1;
-        my $reverse   = 0;
 
         while ($more_to_do) {
 
@@ -18190,12 +18189,7 @@ EOM
             my $nstop = $nmax - $num_freeze;
             for my $iter ( $nbeg + 1 .. $nstop ) {
 
-                # alternating sweep direction gives symmetric results
-                # for recombining lines which exceed the line length
-                # such as eval {{{{.... }}}}
-                my $n;
-                if   ($reverse) { $n = $nbeg + 1 + $nstop - $iter; }
-                else            { $n = $iter }
+                my $n = $iter;
 
                 #----------------------------------------------------------
                 # If we join the current pair of lines,
@@ -18312,8 +18306,6 @@ EOM
                     last;
                 }
 
-                $reverse = 0;
-
                 #----------------------------------------------------------
                 # Recombine Section 2:
                 # Examine token at $iend_1 (right end of first line of pair)