diff options
author | Lourens Naudé <lourens@methodmissing.com> | 2010-02-08 00:05:33 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-03-01 11:22:41 -0800 |
commit | 2060977b767061a42eb8db2d5c3a30d205a94123 (patch) | |
tree | a5263656266b77996786612f71a0fa8d1bc19c88 /activesupport/lib | |
parent | 82deaf5f052caf0a906ed0e83c6efd00c057b5ba (diff) | |
download | rails-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/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/hash/keys.rb | 2 |
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 |