aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-03-30 08:55:16 -0700
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-03-30 08:55:16 -0700
commit6a3794b404a252751c0b558fe94f7ee735c2535c (patch)
treec78a6370b8e4829c54acf51fba82027caba16312 /activesupport
parent2432469e7f076b878e0551becaddc2807667f677 (diff)
parentbd674fd4e58387c331a7608bbfd48a690471c556 (diff)
downloadrails-6a3794b404a252751c0b558fe94f7ee735c2535c.tar.gz
rails-6a3794b404a252751c0b558fe94f7ee735c2535c.tar.bz2
rails-6a3794b404a252751c0b558fe94f7ee735c2535c.zip
Merge pull request #9997 from vipulnsward/hash_destructive_merge
Change merge to merge! to avoid creating new objects
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/callbacks.rb2
-rw-r--r--activesupport/lib/active_support/hash_with_indifferent_access.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb
index f2d9df6d13..6c0cae71ed 100644
--- a/activesupport/lib/active_support/callbacks.rb
+++ b/activesupport/lib/active_support/callbacks.rb
@@ -315,7 +315,7 @@ module ActiveSupport
@config = {
:terminator => "false",
:scope => [ :kind ]
- }.merge(config)
+ }.merge!(config)
end
def compile
diff --git a/activesupport/lib/active_support/hash_with_indifferent_access.rb b/activesupport/lib/active_support/hash_with_indifferent_access.rb
index 306d80b2df..837db05dcc 100644
--- a/activesupport/lib/active_support/hash_with_indifferent_access.rb
+++ b/activesupport/lib/active_support/hash_with_indifferent_access.rb
@@ -78,7 +78,7 @@ module ActiveSupport
end
def self.[](*args)
- new.merge(Hash[*args])
+ new.merge!(Hash[*args])
end
alias_method :regular_writer, :[]= unless method_defined?(:regular_writer)