diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-03-21 09:31:44 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-03-21 09:31:44 +0900 |
| commit | 2c44f96e78832dd42e35a9cae6e90dccaf5c2178 (patch) | |
| tree | 52121a3a9f0845c25a40aeaa975068805d9d599f /mrblib/hash.rb | |
| parent | 287f317f051894b53f43c659d89e75a46f2203ad (diff) | |
| download | mruby-2c44f96e78832dd42e35a9cae6e90dccaf5c2178.tar.gz mruby-2c44f96e78832dd42e35a9cae6e90dccaf5c2178.zip | |
reduce hash creation by using update method
Diffstat (limited to 'mrblib/hash.rb')
| -rw-r--r-- | mrblib/hash.rb | 5 |
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 ## |
