diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-01-06 20:28:17 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-01-06 20:28:17 +0000 |
commit | 523658c1dffc6d125898caac6bf43118fbb3e27e (patch) | |
tree | ab91ea0663b957183cc1c8f6105f7b1e7d5e0882 /activesupport | |
parent | 98292128492840376064994c561de95aeb0c3be6 (diff) | |
download | rails-523658c1dffc6d125898caac6bf43118fbb3e27e.tar.gz rails-523658c1dffc6d125898caac6bf43118fbb3e27e.tar.bz2 rails-523658c1dffc6d125898caac6bf43118fbb3e27e.zip |
Simplify and speedup Hash#stringify_keys! References #10717 [Cheah Chu Yeow]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8576 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/core_ext/hash/keys.rb | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/core_ext/hash/keys.rb b/activesupport/lib/active_support/core_ext/hash/keys.rb index ff8e68faa1..7312bcb416 100644 --- a/activesupport/lib/active_support/core_ext/hash/keys.rb +++ b/activesupport/lib/active_support/core_ext/hash/keys.rb @@ -13,10 +13,7 @@ module ActiveSupport #:nodoc: # Destructively convert all keys to strings. def stringify_keys! keys.each do |key| - unless key.class.to_s == "String" # weird hack to make the tests run when string_ext_test.rb is also running - self[key.to_s] = self[key] - delete(key) - end + self[key.to_s] = delete(key) end self end |