From 44eb53f5a5f1ea2e5aee93d0caf995f42b3179f7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 6 Feb 2011 01:42:31 +0000 Subject: kill some unnecessary &block usage We were needlessly allocating objects even when using yield. --- lib/rainbows/sendfile.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/rainbows/sendfile.rb') diff --git a/lib/rainbows/sendfile.rb b/lib/rainbows/sendfile.rb index 545b85c..767c0f9 100644 --- a/lib/rainbows/sendfile.rb +++ b/lib/rainbows/sendfile.rb @@ -63,7 +63,7 @@ class Rainbows::Sendfile < Struct.new(:app) end # fallback in case our +to_path+ doesn't get handled for whatever reason - def each(&block) + def each buf = '' File.open(to_path) do |fp| yield buf while fp.read(0x4000, buf) -- cgit v1.2.3-24-ge0c7