From 43d6ec33c3dd7497e27127adfffeb94722fd4b8d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 21 Jan 2011 15:08:07 -0800 Subject: ev_core: garbage reduction We don't need to allocate new string objects for short-lived strings. We'll pay the price of a constant lookup instead. --- lib/rainbows/event_machine/client.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/rainbows/event_machine') 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 -- cgit v1.2.3-24-ge0c7