aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/hash_with_indifferent_access.rb
diff options
context:
space:
mode:
authorLourens Naude <lourens@methodmissing.com>2009-07-12 12:18:04 +0100
committerCarl Lerche <carllerche@mac.com>2009-07-15 13:23:05 -0700
commit0920e69244026ec83471bb4571e56300045307d3 (patch)
treeea58042cd42a3fdad8ab90f6ea6149ba9e104e2b /activesupport/lib/active_support/hash_with_indifferent_access.rb
parent40b387580ff251e06632fbcc87c2a78c027a6b27 (diff)
downloadrails-0920e69244026ec83471bb4571e56300045307d3.tar.gz
rails-0920e69244026ec83471bb4571e56300045307d3.tar.bz2
rails-0920e69244026ec83471bb4571e56300045307d3.zip
ActiveSupport Hash optimizations [#2902 state:resolved]
Signed-off-by: Carl Lerche <carllerche@mac.com>
Diffstat (limited to 'activesupport/lib/active_support/hash_with_indifferent_access.rb')
-rw-r--r--activesupport/lib/active_support/hash_with_indifferent_access.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/hash_with_indifferent_access.rb b/activesupport/lib/active_support/hash_with_indifferent_access.rb
index 61fc6475a0..543dab4a75 100644
--- a/activesupport/lib/active_support/hash_with_indifferent_access.rb
+++ b/activesupport/lib/active_support/hash_with_indifferent_access.rb
@@ -98,6 +98,10 @@ module ActiveSupport
super other_hash.with_indifferent_access
end
+ def reverse_merge!(other_hash)
+ replace(reverse_merge( other_hash ))
+ end
+
# Removes a specified key from the hash.
def delete(key)
super(convert_key(key))
@@ -109,7 +113,7 @@ module ActiveSupport
# Convert to a Hash with String keys.
def to_hash
- Hash.new(default).merge(self)
+ Hash.new(default).merge!(self)
end
protected