aboutsummaryrefslogtreecommitdiffstats
path: root/ext/date/date_core.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-03 01:56:01 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-03 01:56:01 +0000
commit1d670ab0f090c0232e2a7a619b70ebb559453331 (patch)
tree8b603d1279d3e5f4e53e4d5407074c46a0639920 /ext/date/date_core.c
parentfdfb939d72e8b66540df42821e3facfcda5aaf15 (diff)
downloadruby-1d670ab0f090c0232e2a7a619b70ebb559453331.tar.gz
ext: prefer RB_TYPE_P over comparison TYPE with constants
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/date/date_core.c')
-rw-r--r--ext/date/date_core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/date/date_core.c b/ext/date/date_core.c
index 0775fecbf2..7ed21db5fc 100644
--- a/ext/date/date_core.c
+++ b/ext/date/date_core.c
@@ -304,7 +304,7 @@ union DateData {
inline static VALUE
canon(VALUE x)
{
- if (TYPE(x) == T_RATIONAL) {
+ if (RB_TYPE_P(x, T_RATIONAL)) {
VALUE den = rb_rational_den(x);
if (FIXNUM_P(den) && FIX2LONG(den) == 1)
return rb_rational_num(x);
@@ -5843,7 +5843,7 @@ minus_dd(VALUE self, VALUE other)
if (f_nonzero_p(sf))
r = f_add(r, ns_to_day(sf));
- if (TYPE(r) == T_RATIONAL)
+ if (RB_TYPE_P(r, T_RATIONAL))
return r;
return rb_rational_new1(r);
}
@@ -7048,7 +7048,7 @@ d_lite_marshal_load(VALUE self, VALUE a)
rb_check_frozen(self);
rb_check_trusted(self);
- if (TYPE(a) != T_ARRAY)
+ if (!RB_TYPE_P(a, T_ARRAY))
rb_raise(rb_eTypeError, "expected an array");
switch (RARRAY_LEN(a)) {