From de6b5dd5ffff6e21064f78f24c30c59e391ff370 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 11 Feb 2010 22:15:29 -0800 Subject: use Hash#compare_by_identity for performance When available (Ruby 1.9), we can use Hash#compare_by_identity to improve performance. --- lib/rainbows/rev.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/rainbows/rev.rb') diff --git a/lib/rainbows/rev.rb b/lib/rainbows/rev.rb index 197d138..6650c2b 100644 --- a/lib/rainbows/rev.rb +++ b/lib/rainbows/rev.rb @@ -31,6 +31,11 @@ module Rainbows # all connected clients CONN = {} + if {}.respond_to?(:compare_by_identity) + CONN.compare_by_identity + KATO.compare_by_identity + end + include Core end end -- cgit v1.2.3-24-ge0c7