Commit 56929362 authored by Ryan Lopopolo's avatar Ryan Lopopolo

Fix Range#min fast path with exclusive range

parent 0ad5ba7a
......@@ -58,7 +58,6 @@ class Range
return nil if val == last && exclude_end?
min = val
min -= 1 if exclude_end?
return min
end
......
......@@ -87,6 +87,7 @@ end
assert('Range#min') do
# returns the minimum value in the range when called with no arguments
assert_equal 1, (1..10).min
assert_equal 1, (1...10).min
# returns the minimum value in the Float range when called with no arguments
assert_equal 303.20, (303.20..908.1111).min
......
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