]> git.donarmstrong.com Git - perltidy.git/commitdiff
simplify coding
authorSteve Hancock <perltidy@users.sourceforge.net>
Tue, 28 May 2024 01:57:01 +0000 (18:57 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Tue, 28 May 2024 01:57:01 +0000 (18:57 -0700)
lib/Perl/Tidy.pm

index 75798c9aa2d3ac1e3266ad90777d2ebba8e14f01..1ca0a4257cdcf3d3b84fb594c4a105dd562ec7b0 100644 (file)
@@ -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 '---'