about summary refs log tree commit homepage
path: root/lib/rainbows/event_machine
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-01-21 15:08:07 -0800
committerEric Wong <normalperson@yhbt.net>2011-01-21 16:54:02 -0800
commit43d6ec33c3dd7497e27127adfffeb94722fd4b8d (patch)
tree7f4e519e67900f9d2d5fb9465fbf28d48a4cc1d0 /lib/rainbows/event_machine
parent247ce76b4aabfa42157b9cbf9ebae824819cfff6 (diff)
downloadrainbows-43d6ec33c3dd7497e27127adfffeb94722fd4b8d.tar.gz
We don't need to allocate new string objects for short-lived
strings.  We'll pay the price of a constant lookup instead.
Diffstat (limited to 'lib/rainbows/event_machine')
-rw-r--r--lib/rainbows/event_machine/client.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rainbows/event_machine/client.rb b/lib/rainbows/event_machine/client.rb
index b75d7ee..1b15daa 100644
--- a/lib/rainbows/event_machine/client.rb
+++ b/lib/rainbows/event_machine/client.rb
@@ -21,7 +21,7 @@ class Rainbows::EventMachine::Client < EM::Connection
       end
       EM.next_tick { receive_data(nil) } unless @buf.empty?
     else
-      on_read(data || "") if (@buf.size > 0) || data
+      on_read(data || Z) if (@buf.size > 0) || data
     end
   end