about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-02-06 22:45:29 +0000
committerEric Wong <e@80x24.org>2015-02-06 22:45:58 +0000
commit13fc75cf8aa878f8e0b904b2f77979e46e06b814 (patch)
tree77c46c45d2d069cb33ef659c15f2f1c421b9ed07
parenta46799b231080033320c5eb613baec59e906a8c2 (diff)
downloadunicorn-13fc75cf8aa878f8e0b904b2f77979e46e06b814.tar.gz
favor "a.b(&:c)" form over "a.b { |x| x.c }"
The former is shorter Ruby code and also generates smaller
bytecode.
-rw-r--r--lib/unicorn/http_server.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb
index 895f56d..c44a71e 100644
--- a/lib/unicorn/http_server.rb
+++ b/lib/unicorn/http_server.rb
@@ -69,7 +69,7 @@ class Unicorn::HttpServer
   #
   #   Unicorn::HttpServer::START_CTX[0] = "/home/bofh/2.2.0/bin/unicorn"
   START_CTX = {
-    :argv => ARGV.map { |arg| arg.dup },
+    :argv => ARGV.map(&:dup),
     0 => $0.dup,
   }
   # We favor ENV['PWD'] since it is (usually) symlink aware for Capistrano
@@ -483,7 +483,7 @@ class Unicorn::HttpServer
   end
 
   def after_fork_internal
-    SELF_PIPE.each { |io| io.close }.clear # this is master-only, now
+    SELF_PIPE.each(&:close).clear # this is master-only, now
     @ready_pipe.close if @ready_pipe
     Unicorn::Configurator::RACKUP.clear
     @ready_pipe = @init_listeners = @before_exec = @before_fork = nil