From 92f412c8ead79524da5b823028dda14864f7f8ae Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 13 Feb 2009 22:56:36 -0800 Subject: HttpResponse: use each instead of each_pair to iterate Rack spec specifies #each must be defined, not #each_pair. Hash#each_pair was marginally faster in Ruby 1.8, but in Ruby 1.9.1, Hash#each and Hash#each_pair are the same function. --- lib/unicorn/http_response.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/unicorn/http_response.rb') diff --git a/lib/unicorn/http_response.rb b/lib/unicorn/http_response.rb index 1192d48..e67d2b3 100644 --- a/lib/unicorn/http_response.rb +++ b/lib/unicorn/http_response.rb @@ -44,7 +44,7 @@ module Unicorn out = [ "#{Const::DATE}: #{Time.now.httpdate}\r\n" ] sent = { Const::CONNECTION => true, Const::DATE => true } - headers.each_pair do |key, value| + headers.each do |key, value| if ! sent[key] || ALLOWED_DUPLICATES[key] sent[key] = true out << "#{key}: #{value}\r\n" -- cgit v1.2.3-24-ge0c7