Skip to content

Commit

Permalink
date_core.c: use static ID variables
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu authored and hsbt committed Nov 27, 2018
1 parent efa3df1 commit 3bae248
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ext/date/date_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ 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
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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
}

/*
Expand Down

0 comments on commit 3bae248

Please sign in to comment.