diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-11-10 21:56:42 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-11-10 21:56:42 +0900 |
| commit | 6a5e97b448e82fe55348ab1a7e96b70b2c45f6c1 (patch) | |
| tree | 89abbf8aaa8a4997648686b3d455db7e2373f206 /mrblib | |
| parent | cc20c5ca3a5da0561be8644b7513d947badb1c56 (diff) | |
| parent | f2d8db39be487fcd710c5c5844ae47d3a6920e70 (diff) | |
| download | mruby-6a5e97b448e82fe55348ab1a7e96b70b2c45f6c1.tar.gz mruby-6a5e97b448e82fe55348ab1a7e96b70b2c45f6c1.zip | |
Merge pull request #5121 from shuujii/reduce-memory-usage-of-Hash-object
Reduce memory usage of Hash object
Diffstat (limited to 'mrblib')
| -rw-r--r-- | mrblib/hash.rb | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/mrblib/hash.rb b/mrblib/hash.rb index 7d64addd7..61ede8137 100644 --- a/mrblib/hash.rb +++ b/mrblib/hash.rb @@ -145,26 +145,6 @@ class Hash end ## - # Replaces the contents of <i>hsh</i> with the contents of other hash - # - # ISO 15.2.13.4.23 - def replace(hash) - raise TypeError, "Hash required (#{hash.class} given)" unless Hash === hash - self.clear - hash.each_key{|k| - self[k] = hash[k] - } - if hash.default_proc - self.default_proc = hash.default_proc - else - self.default = hash.default - end - self - end - # ISO 15.2.13.4.17 - alias initialize_copy replace - - ## # Return a hash which contains the content of # +self+ and +other+. If a block is given # it will be called for each element with |
