From 818e82daad13f1c2a5e7fba04bb0b4267b5393bb Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Mon, 27 May 2024 18:57:01 -0700 Subject: [PATCH] simplify coding --- lib/Perl/Tidy.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Perl/Tidy.pm b/lib/Perl/Tidy.pm index 75798c9a..1ca0a425 100644 --- a/lib/Perl/Tidy.pm +++ b/lib/Perl/Tidy.pm @@ -5603,15 +5603,16 @@ sub filter_unknown_options { # $rexpansion = ref to hash with abbreviations as key # $rconfig_file_chatter = messages displayed in --dump-profile # - # Update: $rconfig_string and $rconfig_file_chatter + # Update: + # $rconfig_string and $rconfig_file_chatter # quick check to skip most files if ( ${$rconfig_string} !~ /^\s*---\w/m ) { return } - my @lines = split /^/, ${$rconfig_string}; my $new_config_string; my $change_notices = EMPTY_STRING; - while ( defined( my $line = shift @lines ) ) { + my @lines = split /^/, ${$rconfig_string}; + foreach my $line (@lines) { chomp $line; # look for lines beginning with '---' -- 2.39.5