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:
parent
d97ba0d31b
commit
c1dadf3d62
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue