mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
compar.rb: use equal?() instead of ==
To avoid unnecessary infinite recursion.
This commit is contained in:
+1
-1
@@ -49,7 +49,7 @@ module Comparable
|
||||
# ISO 15.3.3.2.3
|
||||
def == other
|
||||
cmp = self <=> other
|
||||
cmp == 0
|
||||
cmp.equal?(0)
|
||||
end
|
||||
|
||||
##
|
||||
|
||||
Reference in New Issue
Block a user