summaryrefslogtreecommitdiff
path: root/rational.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-08-02 23:37:08 (GMT)
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-08-03 01:18:39 (GMT)
commit4ea5c5610aeadecf78fdd2b7d6faad8574953620 (patch)
tree466d75d43f9d734a74affdbe1bce7e1d2e9e2e8e /rational.c
parent0bd1cd677f769ac6128989bf1d021753698fdaac (diff)
Predefine some IDs
Diffstat (limited to 'rational.c')
-rw-r--r--rational.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/rational.c b/rational.c
index ed7e356..d032cbd 100644
--- a/rational.c
+++ b/rational.c
@@ -33,8 +33,10 @@
VALUE rb_cRational;
-static ID id_abs, id_idiv, id_integer_p,
+static ID id_abs, id_integer_p,
id_i_num, id_i_den;
+
+#define id_idiv idDiv
#define id_to_i idTo_i
#define f_boolcast(x) ((x) ? Qtrue : Qfalse)
@@ -1601,7 +1603,7 @@ f_ceil(VALUE x)
return rb_funcall(x, id_ceil, 0);
}
-#define id_quo rb_intern("quo")
+#define id_quo idQuo
static VALUE
f_quo(VALUE x, VALUE y)
{
@@ -2013,7 +2015,7 @@ VALUE
rb_numeric_quo(VALUE x, VALUE y)
{
if (RB_FLOAT_TYPE_P(y)) {
- return rb_funcall(x, rb_intern("fdiv"), 1, y);
+ return rb_funcallv(x, idFdiv, 1, &y);
}
if (canonicalization) {
@@ -2711,7 +2713,6 @@ Init_Rational(void)
#define rb_intern(str) rb_intern_const(str)
id_abs = rb_intern("abs");
- id_idiv = rb_intern("div");
id_integer_p = rb_intern("integer?");
id_i_num = rb_intern("@numerator");
id_i_den = rb_intern("@denominator");