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

This commit is contained in:
Santiago Pastorino 2010-10-03 14:52:46 -02:00
parent c28bebef13
commit 10249d7b77
1 changed files with 1 additions and 1 deletions

View File

@ -247,7 +247,7 @@ module ActionMailer
[ 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