about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-06-27 08:46:28 +0000
committerEric Wong <normalperson@yhbt.net>2011-06-27 08:51:37 +0000
commit4785db8cf19899756c4a79462fed861a1d1bd96c (patch)
tree154925fc7cdd53e42082531e9a1e3831aac4ab60
parent441bb8ab48f15f583b82a3f8520648a4694a198f (diff)
downloadunicorn-4785db8cf19899756c4a79462fed861a1d1bd96c.tar.gz
It's still O(n) since we don't maintain a reverse mapping of
spawned processes, but at least we avoid the extra overhead of
creating an array every time.
-rw-r--r--lib/unicorn/http_server.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb
index f033764..02ba965 100644
--- a/lib/unicorn/http_server.rb
+++ b/lib/unicorn/http_server.rb
@@ -465,7 +465,7 @@ class Unicorn::HttpServer
   def spawn_missing_workers
     worker_nr = -1
     until (worker_nr += 1) == @worker_processes
-      WORKERS.values.include?(worker_nr) and next
+      WORKERS.value?(worker_nr) and next
       worker = Worker.new(worker_nr)
       before_fork.call(self, worker)
       if pid = fork