summaryrefslogtreecommitdiffhomepage
path: root/mrblib
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2018-04-28 11:24:26 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2018-04-28 11:26:23 +0900
commit50a9c5d7c704e84c6bdec9affa270824fed02034 (patch)
tree59b7fb5558399a37d0de50dbf208cccec39a8f6c /mrblib
parent4b29abc565b5791d6d39b28358e2c82c17d3c500 (diff)
downloadmruby-50a9c5d7c704e84c6bdec9affa270824fed02034.tar.gz
mruby-50a9c5d7c704e84c6bdec9affa270824fed02034.zip
Update the patch to not use `funcall` in C; ref #4013
Diffstat (limited to 'mrblib')
-rw-r--r--mrblib/enum.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/mrblib/enum.rb b/mrblib/enum.rb
index 20638f7e8..a97a26f97 100644
--- a/mrblib/enum.rb
+++ b/mrblib/enum.rb
@@ -333,4 +333,15 @@ module Enumerable
#
# ISO 15.3.2.2.20
alias to_a entries
+
+ # redefine #hash 15.3.1.3.15
+ def hash
+ h = 12347
+ i = 0
+ self.each do |e|
+ h = __update_hash(h, i, e.hash)
+ i += 1
+ end
+ h
+ end
end