aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorLourens Naudé <lourens@methodmissing.com>2010-02-08 00:05:33 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2010-03-01 11:22:41 -0800
commit2060977b767061a42eb8db2d5c3a30d205a94123 (patch)
treea5263656266b77996786612f71a0fa8d1bc19c88 /activesupport
parent82deaf5f052caf0a906ed0e83c6efd00c057b5ba (diff)
downloadrails-2060977b767061a42eb8db2d5c3a30d205a94123.tar.gz
rails-2060977b767061a42eb8db2d5c3a30d205a94123.tar.bz2
rails-2060977b767061a42eb8db2d5c3a30d205a94123.zip
Hash#symbolize_keys(!) optimizations
[#3891 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
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 045a6944fa..e4d429fc2b 100644
--- a/activesupport/lib/active_support/core_ext/hash/keys.rb
+++ b/activesupport/lib/active_support/core_ext/hash/keys.rb
@@ -22,7 +22,7 @@ class Hash
# to +to_sym+.
def symbolize_keys!
keys.each do |key|
- self[(key.to_sym rescue key) || key] = delete(key)
+ self[(key.to_sym rescue key)] = delete(key) if key.respond_to?(:to_sym) && !key.is_a?(Fixnum)
end
self
end