From acf77c65be41013095a00a8a34c75555fd8b3e8c Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Fri, 13 Jan 2023 12:40:46 -0800 Subject: [PATCH] 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). --- lib/Perl/Tidy/Formatter.pm | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) 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) -- 2.39.5