diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-06 00:19:23 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-06 00:19:23 +0000 |
commit | 941621946feaecf6e53f9e10b487c3bd04886f0b (patch) | |
tree | 5aefb413cf76c77d59caf26727312cce19138e31 /io.c | |
parent | e0aaf5f5ca8e10173da20389827f304bf60c1c09 (diff) |
io.c: use RB_INTEGER_TYPE_P
* io.c (fptr_finalize): use dedicated macro RB_INTEGER_TYPE_P.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -4292,14 +4292,10 @@ fptr_finalize(rb_io_t *fptr, int noraise) } if (!NIL_P(err) && !noraise) { - switch (TYPE(err)) { - case T_FIXNUM: - case T_BIGNUM: + if (RB_INTEGER_TYPE_P(err)) rb_syserr_fail_path(NUM2INT(err), fptr->pathv); - - default: - rb_exc_raise(err); - } + else + rb_exc_raise(err); } free_io_buffer(&fptr->rbuf); free_io_buffer(&fptr->wbuf); |