summaryrefslogtreecommitdiffhomepage
path: root/mrblib
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-03-21 09:31:44 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-03-21 09:31:44 +0900
commit2c44f96e78832dd42e35a9cae6e90dccaf5c2178 (patch)
tree52121a3a9f0845c25a40aeaa975068805d9d599f /mrblib
parent287f317f051894b53f43c659d89e75a46f2203ad (diff)
downloadmruby-2c44f96e78832dd42e35a9cae6e90dccaf5c2178.tar.gz
mruby-2c44f96e78832dd42e35a9cae6e90dccaf5c2178.zip
reduce hash creation by using update method
Diffstat (limited to 'mrblib')
-rw-r--r--mrblib/hash.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/mrblib/hash.rb b/mrblib/hash.rb
index c15f770f7..20dd67091 100644
--- a/mrblib/hash.rb
+++ b/mrblib/hash.rb
@@ -183,6 +183,11 @@ class Hash
}
h
end
+
+ def __update(h)
+ h.each{|k,v| self[k] = v}
+ self
+ end
end
##