From 672befaa67ace119c07ee346124526c1e0c4a1f1 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 3 Jul 2009 01:44:28 -0700 Subject: Avoid temporary array creation Array#+= creates a new array before assigning, Array#concat just appends one array to another without an intermediate one. --- lib/unicorn.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/unicorn.rb b/lib/unicorn.rb index 281aa7d..3e1d418 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -131,8 +131,7 @@ module Unicorn end end set_names = listener_names(listeners) - dead_names += cur_names - set_names - dead_names.uniq! + dead_names.concat(cur_names - set_names).uniq! LISTENERS.delete_if do |io| if dead_names.include?(sock_name(io)) -- cgit v1.2.3-24-ge0c7