Permalink
Browse files

fewer objects, no loop in convert_content_type. Closes #2883.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3058 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent c63f3bd commit ba942dfc4523610ad37d2414627698563b91b125 @jeremy jeremy committed Nov 16, 2005
Showing with 9 additions and 6 deletions.
  1. +1 −1 actionpack/CHANGELOG
  2. +8 −5 actionpack/lib/action_controller/cgi_process.rb
View
@@ -1,6 +1,6 @@
*SVN*
-* Performance tweaks: use Set instead of Array to speed up prototype helper include? calls. Avoid logging code if logger is nil. Inline commonly-called template presence checks. #2880, #2881, #2882 [Stefan Kaes]
+* Performance tweaks: use Set instead of Array to speed up prototype helper include? calls. Avoid logging code if logger is nil. Inline commonly-called template presence checks. #2880, #2881, #2882, #2883 [Stefan Kaes]
* MemCache store may be given multiple addresses. #2869 [Ryan Carver <ryan@fivesevensix.com>]
@@ -183,11 +183,14 @@ def out(output = $stdout)
private
def convert_content_type!(headers)
- %w( Content-Type Content-type content-type ).each do |ct|
- if headers[ct]
- headers["type"] = headers[ct]
- headers.delete(ct)
- end
+ if header = headers.delete("Content-Type")
+ headers["type"] = header
+ end
+ if header = headers.delete("Content-type")
+ headers["type"] = header
+ end
+ if header = headers.delete("content-type")
+ headers["type"] = header
end
end
end

0 comments on commit ba942df

Please sign in to comment.