* [PATCH] favor "a.b(&:c)" form over "a.b { |x| x.c }"
@ 2015-02-06 22:50 Eric Wong
0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2015-02-06 22:50 UTC (permalink / raw)
To: unicorn-public
The former is shorter Ruby code and also generates smaller
bytecode.
---
lib/unicorn/http_server.rb | 4 ++--
1 file 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
--
EW
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-02-06 22:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-06 22:50 [PATCH] favor "a.b(&:c)" form over "a.b { |x| x.c }" Eric Wong
Code repositories for project(s) associated with this public inbox
https://yhbt.net/unicorn.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).