From d952a7afc5ef5826f8b4e9c339bc6a5974c9fd3f Mon Sep 17 00:00:00 2001 From: Gordon Chan Date: Thu, 31 Jul 2014 12:12:32 +1200 Subject: Removed unnecessary call to 'convert_key' in 'HashWithIndifferentAccess#to_hash' All the keys are already Strings by virtue of being a HashWithIndifferentAccess. --- activesupport/lib/active_support/hash_with_indifferent_access.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/hash_with_indifferent_access.rb b/activesupport/lib/active_support/hash_with_indifferent_access.rb index dc76a77a6c..30e27267a0 100644 --- a/activesupport/lib/active_support/hash_with_indifferent_access.rb +++ b/activesupport/lib/active_support/hash_with_indifferent_access.rb @@ -246,9 +246,9 @@ module ActiveSupport # Convert to a regular hash with string keys. def to_hash - _new_hash= {} + _new_hash = {} each do |key, value| - _new_hash[convert_key(key)] = convert_value(value, for: :to_hash) + _new_hash[key] = convert_value(value, for: :to_hash) end Hash.new(default).merge!(_new_hash) end -- cgit v1.2.3