From 2c44f96e78832dd42e35a9cae6e90dccaf5c2178 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Fri, 21 Mar 2014 09:31:44 +0900 Subject: reduce hash creation by using update method --- mrblib/hash.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mrblib') 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 ## -- cgit v1.2.3