Skip to content

Commit

Permalink
Merge pull request rails#6886 from nertzy/faster_stringify_and_symbol…
Browse files Browse the repository at this point in the history
…ize_keys

Speed up Hash#transform_keys using Hash#each_key
  • Loading branch information
carlosantoniodasilva committed Jun 28, 2012
2 parents 692b64e + f6bedc9 commit 3dc753f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activesupport/lib/active_support/core_ext/hash/keys.rb
Expand Up @@ -7,7 +7,7 @@ class Hash
# # => { "NAME" => "Rob", "AGE" => "28" }
def transform_keys
result = {}
keys.each do |key|
each_key do |key|
result[yield(key)] = self[key]
end
result
Expand Down

0 comments on commit 3dc753f

Please sign in to comment.