Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

PERF: change inject({}) with Hash + map

  • Loading branch information...
commit 10249d7b7728525fb7660409e3bbc9e0286dbf0f 1 parent c28bebe
@spastorino spastorino authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  actionmailer/lib/action_mailer/old_api.rb
View
2  actionmailer/lib/action_mailer/old_api.rb
@@ -247,7 +247,7 @@ def parse_content_type(defaults=nil)
[ nil, {} ]
else
ctype, *attrs = @content_type.split(/;\s*/)
- attrs = attrs.inject({}) { |h,s| k,v = s.split(/\=/, 2); h[k] = v; h }
+ attrs = Hash[attrs.map { |attr| attr.split(/\=/, 2) }]
[ctype, {"charset" => @charset}.merge(attrs)]
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.