about summary refs log tree commit homepage
path: root/lib/rainbows/sync_close.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-02-06 06:19:09 +0000
committerEric Wong <normalperson@yhbt.net>2011-02-06 06:19:09 +0000
commit53bac4f65d9430495c8043b239cc936012ea7a8d (patch)
tree8e7e520e1e50725e66fad8693181c650f7d77aee /lib/rainbows/sync_close.rb
parent44eb53f5a5f1ea2e5aee93d0caf995f42b3179f7 (diff)
downloadrainbows-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/sync_close.rb')
-rw-r--r--lib/rainbows/sync_close.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rainbows/sync_close.rb b/lib/rainbows/sync_close.rb
index a336262..75f119e 100644
--- a/lib/rainbows/sync_close.rb
+++ b/lib/rainbows/sync_close.rb
@@ -20,8 +20,8 @@ class Rainbows::SyncClose
     @body.to_path
   end
 
-  def each(&block)
-    @body.each(&block)
+  def each
+    @body.each { |x| yield x }
   end
 
   def to_io