diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-09-29 11:07:45 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-09-29 11:07:45 +0000 |
commit | 8e6e8e628888aa251f771ce8b3fe30a6b41a7a0e (patch) | |
tree | e531ed455f2ffb110e9a16de2161b3865a19d582 /process.c | |
parent | 68f97d7851481e11ce90bb349345dc4caed00cf7 (diff) | |
download | ruby-8e6e8e628888aa251f771ce8b3fe30a6b41a7a0e.tar.gz |
* use RB_TYPE_P which is optimized for constant types, instead of
comparison with TYPE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r-- | process.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1418,7 +1418,7 @@ check_exec_redirect(VALUE key, VALUE val, VALUE options) flags = rb_ary_entry(val, 1); if (NIL_P(flags)) flags = INT2NUM(O_RDONLY); - else if (TYPE(flags) == T_STRING) + else if (RB_TYPE_P(flags, T_STRING)) flags = INT2NUM(rb_io_modestr_oflags(StringValueCStr(flags))); else flags = rb_to_int(flags); @@ -1433,7 +1433,7 @@ check_exec_redirect(VALUE key, VALUE val, VALUE options) index = EXEC_OPTION_OPEN; path = val; FilePathValue(path); - if (TYPE(key) == T_FILE) + if (RB_TYPE_P(key, T_FILE)) key = check_exec_redirect_fd(key, 1); if (FIXNUM_P(key) && (FIX2INT(key) == 1 || FIX2INT(key) == 2)) flags = INT2NUM(O_WRONLY|O_CREAT|O_TRUNC); @@ -1453,7 +1453,7 @@ check_exec_redirect(VALUE key, VALUE val, VALUE options) ary = hide_obj(rb_ary_new()); rb_ary_store(options, index, ary); } - if (TYPE(key) != T_ARRAY) { + if (!RB_TYPE_P(key, T_ARRAY)) { VALUE fd = check_exec_redirect_fd(key, !NIL_P(param)); rb_ary_push(ary, hide_obj(rb_assoc_new(fd, param))); } |