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/dev_fd_response.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 b2367d7..ba1fdaa 100644 --- a/lib/rainbows/dev_fd_response.rb +++ b/lib/rainbows/dev_fd_response.rb @@ -31,7 +31,7 @@ class Rainbows::DevFdResponse < Struct.new(:app) return response if STATUS_WITH_NO_ENTITY_BODY.include?(status) io = body.to_io if body.respond_to?(:to_io) - io ||= File.open(body.to_path, 'rb') if body.respond_to?(:to_path) + io ||= File.open(body.to_path) if body.respond_to?(:to_path) return response if io.nil? headers = HeaderHash.new(headers) -- cgit v1.2.3-24-ge0c7