1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Avoid creating an extra hash

This commit is contained in:
Carlos Antonio da Silva 2014-07-31 08:07:32 -03:00
parent d97ba0d31b
commit c1dadf3d62

View file

@ -246,11 +246,11 @@ module ActiveSupport
# Convert to a regular hash with string keys.
def to_hash
_new_hash = {}
_new_hash = Hash.new(default)
each do |key, value|
_new_hash[key] = convert_value(value, for: :to_hash)
end
Hash.new(default).merge!(_new_hash)
_new_hash
end
protected