Permalink
Browse files

Fix Range#max behavior in 1.9 mode

This rolls back a change made in 04c2c40. If a range is inclusive and
the start and end points are the same, Range#max should return the
endpoint, not nil.
  • Loading branch information...
1 parent 4b483c2 commit f589a54b38f5097481bb8b2cbc922717062a52c0 @rf- rf- committed Dec 28, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 kernel/common/range19.rb
View
@@ -13,7 +13,7 @@ def first(n=undefined)
def max(&block)
return super(&block) if block_given? || (@excl && !@end.kind_of?(Numeric))
- return nil unless @end > @begin
+ return nil if @end < @begin || (@excl && @end == @begin)
if @excl
unless @end.kind_of?(Integer)

0 comments on commit f589a54

Please sign in to comment.