]> git.donarmstrong.com Git - perltidy.git/commitdiff
minor cleanups
authorSteve Hancock <perltidy@users.sourceforge.net>
Sun, 23 May 2021 13:23:03 +0000 (06:23 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sun, 23 May 2021 13:23:03 +0000 (06:23 -0700)
lib/Perl/Tidy.pm
local-docs/BugLog.pod

index d785497fbd0a77ccb07a81e4cae732176754c6d8..dd26e5f34cd77eb92c1affcd11e65a6257cef1e7 100644 (file)
@@ -835,27 +835,27 @@ EOM
     # Ready to go...
     # main loop to process all files in argument list
     #---------------------------------------------------------------
-    my $number_of_files = @ARGV;
-    my $formatter       = undef;
-    my $tokenizer       = undef;
+    my $formatter = undef;
+    my $tokenizer = undef;
+
+    # Remove duplicate filenames.  Otherwise, for example if the user entered
+    #     perltidy -b myfile.pl myfile.pl
+    # the backup version of the original would be lost.
+    if ( @ARGV > 1 ) {
+        my %seen = ();
+        @ARGV = grep { !$seen{$_}++ } @ARGV;
+    }
 
     # If requested, process in order of increasing file size
     # This can significantly reduce perl's virtual memory usage during testing.
-    if ( $number_of_files > 1 && $rOpts->{'file-size-order'} ) {
+    if ( @ARGV > 1 && $rOpts->{'file-size-order'} ) {
         @ARGV =
           map  { $_->[0] }
           sort { $a->[1] <=> $b->[1] }
           map  { [ $_, -e $_ ? -s $_ : 0 ] } @ARGV;
     }
 
-    # Remove duplicate filenames.  Otherwise, for example if the user entered
-    #     perltidy -b myfile.pl myfile.pl
-    # the backup version of the original would be lost.
-    if ( $number_of_files > 1 ) {
-        my %seen = ();
-        @ARGV = grep { !$seen{$_}++ } @ARGV;
-    }
-
+    my $number_of_files = @ARGV;
     while ( my $input_file = shift @ARGV ) {
         my $fileroot;
         my @input_file_stat;
index 1b856f37430d1f67d5fe7e551b4e2dfadc3d11c0..1c2946b09ce143439169f837bec1599412b74727 100644 (file)
@@ -9,7 +9,7 @@ to -lp formatting mode.
 
 This fixes case b1131.
 
-21 May 2021.
+21 May 2021, a4ec4c1.
 
 =item B<Fix inconsistency involving counting commas>
 
@@ -19,7 +19,7 @@ counting the number of line ending commas in lists.
 
 This fixes case b1130.
 
-15 May 2021.
+15 May 2021, 90cceb1.
 
 =item B<Slightly modify line breaks for -lp indentation>