From 62b750bb55916e526fb53cb4c19da777872c27f6 Mon Sep 17 00:00:00 2001 From: shugo Date: Sat, 23 Jan 2016 11:16:09 +0000 Subject: * range.c (range_eqq): revert r11113 because rb_call_super() is called in range_include() and thus r11113 doesn't work when the receiver Range object consists of non linear objects such as Date objects. [ruby-core:72908] [Bug #12003] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- range.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'range.c') diff --git a/range.c b/range.c index 95b1b92053..ab3f1af9e2 100644 --- a/range.c +++ b/range.c @@ -23,7 +23,6 @@ static ID id_beg, id_end, id_excl, id_integer_p, id_div; #define id_succ idSucc static VALUE r_cover_p(VALUE, VALUE, VALUE, VALUE); -static VALUE range_include(VALUE range, VALUE val); #define RANGE_BEG(r) (RSTRUCT(r)->as.ary[0]) #define RANGE_END(r) (RSTRUCT(r)->as.ary[1]) @@ -1135,12 +1134,7 @@ range_inspect(VALUE range) static VALUE range_eqq(VALUE range, VALUE val) { - ID pred; - CONST_ID(pred, "include?"); - if (rb_method_basic_definition_p(RBASIC_CLASS(range), pred)) { - return range_include(range, val); - } - return rb_funcall(range, pred, 1, val); + return rb_funcall(range, rb_intern("include?"), 1, val); } -- cgit v1.2.3