Permalink
Browse files

Merge pull request #9997 from vipulnsward/hash_destructive_merge

Change merge to merge! to avoid creating new objects
  • Loading branch information...
carlosantoniodasilva committed Mar 30, 2013
2 parents 2432469 + bd674fd commit 6a3794b404a252751c0b558fe94f7ee735c2535c
@@ -315,7 +315,7 @@ def initialize(name, config)
@config = {
:terminator => "false",
:scope => [ :kind ]
- }.merge(config)
+ }.merge!(config)
end
def compile
@@ -78,7 +78,7 @@ def self.new_from_hash_copying_default(hash)
end
def self.[](*args)
- new.merge(Hash[*args])
+ new.merge!(Hash[*args])
end
alias_method :regular_writer, :[]= unless method_defined?(:regular_writer)

0 comments on commit 6a3794b

Please sign in to comment.