From ec3db439b001c3413e0d755d9ce6bd707caf88db Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 20 Nov 2014 03:53:48 +0000 Subject: favor Array#map! for freshly-split arrays This barely reduces garbage objects at startup, but less garbage is usually better. --- lib/yahns/server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/yahns/server.rb b/lib/yahns/server.rb index b28e741..1196d2d 100644 --- a/lib/yahns/server.rb +++ b/lib/yahns/server.rb @@ -313,7 +313,7 @@ class Yahns::Server # :nodoc: # because that can completely break the non-blocking one. # Unfortunately, there is no one-off MSG_DONTWAIT-like flag for # accept4(2). - inherited = ENV['YAHNS_FD'].to_s.split(',').map do |fd| + inherited = ENV['YAHNS_FD'].to_s.split(',').map! do |fd| io = Socket.for_fd(fd.to_i) set_server_sockopt(io, sock_opts(io)) @logger.info "inherited addr=#{sock_name(io)} fd=#{fd}" -- cgit v1.2.3-24-ge0c7