Permalink
Browse files

Simplify and speedup Hash#stringify_keys! References #10717 [Cheah Ch…

…u Yeow]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8576 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 9829212 commit 523658c1dffc6d125898caac6bf43118fbb3e27e @jeremy jeremy committed Jan 6, 2008
Showing with 1 addition and 4 deletions.
  1. +1 −4 activesupport/lib/active_support/core_ext/hash/keys.rb
@@ -13,10 +13,7 @@ def stringify_keys
# 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

0 comments on commit 523658c

Please sign in to comment.