1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

date_core.c: use static ID variables

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-11-13 04:51:46 +00:00
parent 598a4bfb0c
commit 3d5be5f86a

View file

@ -97,7 +97,7 @@ f_ge_p(VALUE x, VALUE y)
{
if (FIXNUM_P(x) && FIXNUM_P(y))
return f_boolcast(FIX2LONG(x) >= FIX2LONG(y));
return rb_funcall(x, rb_intern(">="), 1, y);
return rb_funcall(x, id_ge_p, 1, y);
}
inline static VALUE
@ -105,7 +105,7 @@ f_eqeq_p(VALUE x, VALUE y)
{
if (FIXNUM_P(x) && FIXNUM_P(y))
return f_boolcast(FIX2LONG(x) == FIX2LONG(y));
return rb_funcall(x, rb_intern("=="), 1, y);
return rb_funcall(x, id_eqeq_p, 1, y);
}
inline static VALUE
@ -6271,7 +6271,7 @@ cmp_gen(VALUE self, VALUE other)
return INT2FIX(f_cmp(m_ajd(dat), other));
else if (k_date_p(other))
return INT2FIX(f_cmp(m_ajd(dat), f_ajd(other)));
return rb_num_coerce_cmp(self, other, rb_intern("<=>"));
return rb_num_coerce_cmp(self, other, id_cmp);
}
static VALUE
@ -6400,7 +6400,7 @@ equal_gen(VALUE self, VALUE other)
return f_eqeq_p(m_real_local_jd(dat), other);
else if (k_date_p(other))
return f_eqeq_p(m_real_local_jd(dat), f_jd(other));
return rb_num_coerce_cmp(self, other, rb_intern("=="));
return rb_num_coerce_cmp(self, other, id_eqeq_p);
}
/*