From 53bac4f65d9430495c8043b239cc936012ea7a8d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 6 Feb 2011 06:19:09 +0000 Subject: minimize &block usage for yield No need to allocate a proc every time when we can just yield much more efficiently. --- lib/rainbows/ev_core/cap_input.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/rainbows/ev_core') diff --git a/lib/rainbows/ev_core/cap_input.rb b/lib/rainbows/ev_core/cap_input.rb index 4865da4..06887d5 100644 --- a/lib/rainbows/ev_core/cap_input.rb +++ b/lib/rainbows/ev_core/cap_input.rb @@ -15,7 +15,7 @@ class Rainbows::EvCore::CapInput end def gets; @io.gets; end - def each(&block); @io.each(&block); end + def each; @io.each { |x| yield x }; end def size; @io.size; end def rewind; @io.rewind; end def read(*args); @io.read(*args); end -- cgit v1.2.3-24-ge0c7