From: Steve Hancock Date: Sat, 13 Nov 2021 00:24:32 +0000 (-0800) Subject: put a reasonable limit of 100 on weld cutoff level X-Git-Tag: 20211029.01~14 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=46e23c8e58a6235e641b36d021026e85ae190d32;p=perltidy.git put a reasonable limit of 100 on weld cutoff level --- diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index 793e2b99..242b81f3 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -1846,7 +1846,12 @@ EOM # Cases b1197-b1204 work ok with const=12 but not with const=8 my $const = 16; $stress_level = 0; - foreach my $level ( 0 .. $level_max ) { + + # Put a reasonable limit on stress level (say 100) in case the + # whitespace-cycle variable is used. + my $stress_level_limit = min( 100, $level_max ); + + foreach my $level ( 0 .. $stress_level_limit ) { my $remaining_cycles = max( 0, (