This commit is contained in:
Kouhei Yanagita 2025-08-14 18:21:47 +09:00 committed by GitHub
commit 00cb161ccf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -199,11 +199,10 @@ range_eq(VALUE range, VALUE obj)
static int
r_less(VALUE a, VALUE b)
{
VALUE r = rb_funcall(a, id_cmp, 1, b);
if (NIL_P(r))
return INT_MAX;
return rb_cmpint(r, a, b);
VALUE r;
#define rb_cmpint(cmp, a, b) (NIL_P(r = (cmp)) ? INT_MAX : rb_cmpint(r, (a), (b)))
return OPTIMIZED_CMP(a, b);
#undef rb_cmpint
}
static VALUE