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/dev_fd_response.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/rainbows/dev_fd_response.rb') diff --git a/lib/rainbows/dev_fd_response.rb b/lib/rainbows/dev_fd_response.rb index 1ee3375..eaa4af4 100644 --- a/lib/rainbows/dev_fd_response.rb +++ b/lib/rainbows/dev_fd_response.rb @@ -79,8 +79,8 @@ class Rainbows::DevFdResponse < Struct.new(:app) class Body < Struct.new(:to_io, :to_path, :orig_body) # called by the webserver or other middlewares if they can't # handle #to_path - def each(&block) - to_io.each(&block) + def each + to_io.each { |x| yield x } end # remain Rack::Lint-compatible for people with wonky systems :P -- cgit v1.2.3-24-ge0c7