提交 aa7fdfb8 编写于 作者: C Carlos Antonio da Silva

Remove short circuit return in favor of simple conditional

上级 374d465f
......@@ -35,10 +35,13 @@ def delimiter
# <tt>Range#cover?</tt> uses the previous logic of comparing a value with the range
# endpoints, which is fast but is only accurate on Numeric, Time, or DateTime ranges.
def inclusion_method(enumerable)
return :include? unless enumerable.is_a?(Range)
case enumerable.first
when Numeric, Time, DateTime
:cover?
if enumerable.is_a? Range
case enumerable.first
when Numeric, Time, DateTime
:cover?
else
:include?
end
else
:include?
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册