aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-06-27 18:00:33 -0700
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-06-27 18:00:33 -0700
commit3dc753fa51fef19663b3d666211cdaccd5de010f (patch)
treeb1ea543fd1b26687320c51c0fdf528ca941ab3d8 /activesupport
parent692b64e3ac9191abf03578e803f39905d90437ed (diff)
parentf6bedc960dfbd2a5262d65c69fb51789b060643e (diff)
downloadrails-3dc753fa51fef19663b3d666211cdaccd5de010f.tar.gz
rails-3dc753fa51fef19663b3d666211cdaccd5de010f.tar.bz2
rails-3dc753fa51fef19663b3d666211cdaccd5de010f.zip
Merge pull request #6886 from nertzy/faster_stringify_and_symbolize_keys
Speed up Hash#transform_keys using Hash#each_key
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/hash/keys.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/hash/keys.rb b/activesupport/lib/active_support/core_ext/hash/keys.rb
index 8e728691c6..e753e36124 100644
--- a/activesupport/lib/active_support/core_ext/hash/keys.rb
+++ b/activesupport/lib/active_support/core_ext/hash/keys.rb
@@ -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