summaryrefslogtreecommitdiff
path: root/ext/date/date_parse.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_parse.c
parentfdfb939d72e8b66540df42821e3facfcda5aaf15 (diff)
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_parse.c')
-rw-r--r--ext/date/date_parse.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/date/date_parse.c b/ext/date/date_parse.c
index 3003b45..239e264 100644
--- a/ext/date/date_parse.c
+++ b/ext/date/date_parse.c
@@ -70,7 +70,7 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
{
VALUE c = Qnil;
- if (TYPE(m) != T_STRING)
+ if (!RB_TYPE_P(m, T_STRING))
m = f_to_s(m);
if (!NIL_P(y) && !NIL_P(m) && NIL_P(d)) {
@@ -585,12 +585,12 @@ date_zone_to_diff(VALUE str)
if (NIL_P(hour))
offset = INT2FIX(0);
else {
- if (TYPE(hour) == T_STRING)
+ if (RB_TYPE_P(hour, T_STRING))
hour = str2num(hour);
offset = f_mul(hour, INT2FIX(3600));
}
if (!NIL_P(min)) {
- if (TYPE(min) == T_STRING)
+ if (RB_TYPE_P(min, T_STRING))
min = str2num(min);
offset = f_add(offset, f_mul(min, INT2FIX(60)));
}