Remove unnecessary `Hash#to_a` call

Inspired by https://github.com/rails/rails/commit/931ee4186b877856b212b0085cd7bd7f6a4aea67

```ruby

def stat(num)
  start = GC.stat(:total_allocated_object)
  num.times { yield }
  total_obj_count = GC.stat(:total_allocated_object) - start
  puts "#{total_obj_count / num} allocations per call"
end

h = { 'x' => 'y' }

stat(100) { h.     each { |pair| pair } }
stat(100) { h.to_a.each { |pair| pair } }

__END__
1 allocations per call
2 allocations per call
```
Merge pull request #15252 from DNNX/formatter-refactoring-2

Remove unnecessary `Hash#to_a` call