зеркало из https://github.com/github/ruby.git
* range.c (range_include): return false unless included in numeric
range. fixed: [ruby-dev:27975] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
949f6fe394
Коммит
c4c90eca34
|
@ -1,3 +1,8 @@
|
|||
Fri Dec 9 23:16:51 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* range.c (range_include): return false unless included in numeric
|
||||
range. fixed: [ruby-dev:27975]
|
||||
|
||||
Thu Dec 8 02:07:19 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* eval.c (umethod_bind): adjust invoking class for module method.
|
||||
|
|
9
range.c
9
range.c
|
@ -625,8 +625,9 @@ range_include(VALUE range, VALUE val)
|
|||
rb_obj_is_kind_of(beg, rb_cNumeric) ||
|
||||
rb_obj_is_kind_of(end, rb_cNumeric);
|
||||
|
||||
if (nv) {
|
||||
numeric_range:
|
||||
if (nv ||
|
||||
!NIL_P(rb_check_to_integer(beg, "to_int")) ||
|
||||
!NIL_P(rb_check_to_integer(end, "to_int"))) {
|
||||
if (r_le(beg, val)) {
|
||||
if (EXCL(range)) {
|
||||
if (r_lt(val, end)) return Qtrue;
|
||||
|
@ -635,10 +636,8 @@ range_include(VALUE range, VALUE val)
|
|||
if (r_le(val, end)) return Qtrue;
|
||||
}
|
||||
}
|
||||
return Qfalse;
|
||||
}
|
||||
if (!NIL_P(rb_check_to_integer(beg, "to_int")) ||
|
||||
!NIL_P(rb_check_to_integer(end, "to_int")))
|
||||
goto numeric_range;
|
||||
return rb_call_super(1, &val);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче