From c587c585e6d327c1646ce33fa10fbef6c27fc74c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 19 Jul 2010 10:09:50 +0000 Subject: no need to pass 'rb' as File.open flags IO#read always returns a binary string buffer if passed an explicit length to read, and we always do that. This is a small garbage reduction. --- lib/rainbows/response/body.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/rainbows/response/body.rb') diff --git a/lib/rainbows/response/body.rb b/lib/rainbows/response/body.rb index e399df7..0a2bb5d 100644 --- a/lib/rainbows/response/body.rb +++ b/lib/rainbows/response/body.rb @@ -41,7 +41,7 @@ module Rainbows::Response::Body # :nodoc: # try to take advantage of Rainbows::DevFdResponse, calling File.open # is a last resort path = body.to_path - path =~ %r{\A/dev/fd/(\d+)\z} ? IO.new($1.to_i) : File.open(path, 'rb') + path =~ %r{\A/dev/fd/(\d+)\z} ? IO.new($1.to_i) : File.open(path) end end -- cgit v1.2.3-24-ge0c7