Replace file-reading loop with list operations
authorJacob Bachmeyer <jcb@gnu.org>
Sun, 16 Oct 2022 04:15:45 +0000 (23:15 -0500)
committerJacob Bachmeyer <jcb@gnu.org>
Sun, 16 Oct 2022 04:15:45 +0000 (23:15 -0500)
gatekeeper.pl

index b6cb6debaf7539b4fc41bca4f665b2d6599b3b0e..f4d3d0bb6c7a4934bc86a50b2bf3424144743412 100755 (executable)
@@ -1279,11 +1279,7 @@ sub read_directive_file {
   open (DIRECTIVE_FILE, "<", $directive_file)
     or ftp_abort("FATAL: open($directive_file) failed: $!");
   my $cnt = 0; # Keep track of the order of directives...
-  while (<DIRECTIVE_FILE>) {
-    my $line = $_;
-    $directive_file_contents .= $line;
-    push(@lines,$line);
-  }
+  $directive_file_contents = join('', (@lines = <DIRECTIVE_FILE>));
   close (DIRECTIVE_FILE) or ftp_warn("close($directive_file) failed: $!");
 
   # If we don't know whose project this file belongs to, because the