compar.rb: use equal?() instead of ==

To avoid unnecessary infinite recursion.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2023-06-19 15:33:13 +09:00
parent 7f85ae2c48
commit 89a1719a13
+1 -1
View File
@@ -49,7 +49,7 @@ module Comparable
# ISO 15.3.3.2.3
def == other
cmp = self <=> other
cmp == 0
cmp.equal?(0)
end
##