Hash#each_key instead of Hash#keys.each. Faster code.

More info at https://github.com/JuanitoFatas/fast-ruby#hasheach_key-instead-of-hashkeyseach-code.

Hash#keys creates new array and then you call #each on that array, while #each_key iterates over hash keys without creating new objects.