re-apply 3644f1ba since we have fixed GC bug

parent 4e790fc1
......@@ -14,11 +14,8 @@ module Comparable
cmp = self <=> other
if cmp.nil?
raise ArgumentError, "comparison of #{self.class} with #{other.class} failed"
elsif cmp < 0
true
else
false
end
cmp < 0
end
##
......@@ -31,11 +28,8 @@ module Comparable
cmp = self <=> other
if cmp.nil?
raise ArgumentError, "comparison of #{self.class} with #{other.class} failed"
elsif cmp <= 0
true
else
false
end
cmp <= 0
end
##
......@@ -46,11 +40,7 @@ module Comparable
# ISO 15.3.3.2.3
def == other
cmp = self <=> other
if cmp == 0
true
else
false
end
cmp == 0
end
##
......@@ -63,11 +53,8 @@ module Comparable
cmp = self <=> other
if cmp.nil?
raise ArgumentError, "comparison of #{self.class} with #{other.class} failed"
elsif cmp > 0
true
else
false
end
cmp > 0
end
##
......@@ -80,11 +67,8 @@ module Comparable
cmp = self <=> other
if cmp.nil?
raise ArgumentError, "comparison of #{self.class} with #{other.class} failed"
elsif cmp >= 0
true
else
false
end
cmp >= 0
end
##
......@@ -95,10 +79,6 @@ module Comparable
#
# ISO 15.3.3.2.6
def between?(min, max)
if self < min or self > max
false
else
true
end
self >= min and self <= max
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment