From 50a9c5d7c704e84c6bdec9affa270824fed02034 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Sat, 28 Apr 2018 11:24:26 +0900 Subject: Update the patch to not use `funcall` in C; ref #4013 --- mrblib/enum.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'mrblib/enum.rb') 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 -- cgit v1.2.3