Permalink
Browse files

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

  • Loading branch information...
1 parent c28bebe commit 10249d7b7728525fb7660409e3bbc9e0286dbf0f @spastorino spastorino committed Oct 3, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 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

0 comments on commit 10249d7

Please sign in to comment.