diff options
author | Eric Wong <e@80x24.org> | 2015-10-28 02:03:45 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-10-28 23:22:31 +0000 |
commit | 17ca034f1283dfa73b8c3be25fc76dc0d111fe65 (patch) | |
tree | a68b3c217205d57d7d4d44cfa23361906d5651bc /lib | |
parent | 963e6b5d24659da316fd57a91b8229683c3c6df2 (diff) | |
download | yahns-17ca034f1283dfa73b8c3be25fc76dc0d111fe65.tar.gz |
Remove unnecessary anonymous procs and conditionals to save some bytecode memory Also, no valid PID can be zero, as kill(2) treats zero specially.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/yahns/server.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/yahns/server.rb b/lib/yahns/server.rb index 4501d86..2db8baf 100644 --- a/lib/yahns/server.rb +++ b/lib/yahns/server.rb @@ -316,14 +316,14 @@ class Yahns::Server # :nodoc: # emulate sd_listen_fds() for systemd sd_pid, sd_fds = ENV.values_at('LISTEN_PID', 'LISTEN_FDS') - if sd_pid && sd_pid.to_i == $$ + if sd_pid.to_i == $$ # 3 = SD_LISTEN_FDS_START - inherited.concat((3...(3 + sd_fds.to_i)).map { |fd| Socket.for_fd(fd) }) + inherited.concat((3...(3 + sd_fds.to_i)).to_a) end # to ease debugging, we will not unset LISTEN_PID and LISTEN_FDS inherited.map! do |fd| - io = String === fd ? Socket.for_fd(fd.to_i) : fd + io = Socket.for_fd(fd.to_i) opts = sock_opts(io) io = server_cast(io, opts) set_server_sockopt(io, opts) |