rails/rails — pull request #16352 by gchan (2014-07-31 00:20:20+00:00)
Title: Removed unnecessary call to 'convert_key' in 'HashWithIndifferentAccess#to_hash'

All the keys are already Strings by virtue of being a `HashWithIndifferentAccess`.

I ran a simple benchmark and observed a 4% performance increase when calling the `to_hash` method.

Benchmark.ips do |x|
x.time = 30
x.warmup = 5

hash = {
:a => 'a',
'b' => { :b1 => 'b1', 'b2' => { 'b3' => 'b3' } },
:c => 'c'
}.with_indifferent_access

x.report("to_hash") do
hash.to_hash
end
end