diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-02-06 06:19:09 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-02-06 06:19:09 +0000 |
commit | 53bac4f65d9430495c8043b239cc936012ea7a8d (patch) | |
tree | 8e7e520e1e50725e66fad8693181c650f7d77aee /lib/rainbows/ev_core | |
parent | 44eb53f5a5f1ea2e5aee93d0caf995f42b3179f7 (diff) | |
download | rainbows-53bac4f65d9430495c8043b239cc936012ea7a8d.tar.gz |
minimize &block usage for yield
No need to allocate a proc every time when we can just yield much more efficiently.
Diffstat (limited to 'lib/rainbows/ev_core')
-rw-r--r-- | lib/rainbows/ev_core/cap_input.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |