From 7f186515f214347bf5e146ce8d16a38f32f9cdfb Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 15 Feb 2011 10:14:22 -0800 Subject: middleware: avoid capturing block variable It's a needless allocation --- lib/raindrops/middleware.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/raindrops/middleware.rb b/lib/raindrops/middleware.rb index 8ddac1f..2eb4e66 100644 --- a/lib/raindrops/middleware.rb +++ b/lib/raindrops/middleware.rb @@ -42,8 +42,8 @@ class Raindrops::Middleware < Struct.new(:app, :stats, :path, :tcp, :unix) end # yield to the Rack server here for writing - def each(&block) - app.each(&block) + def each + app.each { |x| yield x } end # the Rack server should call this after #each (usually ensure-d) -- cgit v1.2.3-24-ge0c7