From a5d88662a519406eea6f180a010af8ef829464e7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 21 Nov 2015 08:52:29 +0000 Subject: Ruby 1.9.3+-only cleanups unicorn 5 will only support Ruby 1.9.3 and later, so remove some checks for Hash#compare_by_identity and IO.copy_stream which we know exist in Ruby 1.9. Favor &:sym proc dispatch to avoid unnecessary captures and bytecode size increases, too. Finally, ensure we fail fast by converting some literal hashes to use non-arrow syntax for symbolic keys. --- lib/rainbows/coolio.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'lib/rainbows/coolio.rb') diff --git a/lib/rainbows/coolio.rb b/lib/rainbows/coolio.rb index a993060..2aba3ea 100644 --- a/lib/rainbows/coolio.rb +++ b/lib/rainbows/coolio.rb @@ -27,15 +27,10 @@ require 'rainbows/coolio_support' module Rainbows::Coolio # :stopdoc: # keep-alive timeout scoreboard - KATO = {} + KATO = {}.compare_by_identity # all connected clients - CONN = {} - - if {}.respond_to?(:compare_by_identity) - CONN.compare_by_identity - KATO.compare_by_identity - end + CONN = {}.compare_by_identity autoload :Client, 'rainbows/coolio/client' autoload :Master, 'rainbows/coolio/master' -- cgit v1.2.3-24-ge0c7