From: Steve Hancock <perltidy@users.sourceforge.net> Date: Fri, 13 Jan 2023 20:40:46 +0000 (-0800) Subject: remove unused code for alternating iteration directions X-Git-Tag: 20221112.04~17 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=acf77c65be41013095a00a8a34c75555fd8b3e8c;p=perltidy.git remove unused code for alternating iteration directions This worked okay but I deactivated it some time ago because there is a danger that it could cause formatting instability (oscillating states). --- diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 8d5292a8..f33813ae 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -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)