summaryrefslogtreecommitdiff
path: root/vm_eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-09-29 11:07:45 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-09-29 11:07:45 +0000
commit8e6e8e628888aa251f771ce8b3fe30a6b41a7a0e (patch)
treee531ed455f2ffb110e9a16de2161b3865a19d582 /vm_eval.c
parent68f97d7851481e11ce90bb349345dc4caed00cf7 (diff)
* 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 'vm_eval.c')
-rw-r--r--vm_eval.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/vm_eval.c b/vm_eval.c
index 393047a2c0..8be6b437c3 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -410,7 +410,7 @@ rb_method_call_status(rb_thread_t *th, const rb_method_entry_t *me, call_type sc
if (((noex & NOEX_MASK) & NOEX_PROTECTED) && scope == CALL_PUBLIC) {
VALUE defined_class = klass;
- if (TYPE(defined_class) == T_ICLASS) {
+ if (RB_TYPE_P(defined_class, T_ICLASS)) {
defined_class = RBASIC(defined_class)->klass;
}
@@ -1063,9 +1063,9 @@ eval_string_with_cref(VALUE self, VALUE src, VALUE scope, NODE *cref, const char
CONST_ID(id_mesg, "mesg");
errat = rb_get_backtrace(errinfo);
mesg = rb_attr_get(errinfo, id_mesg);
- if (!NIL_P(errat) && TYPE(errat) == T_ARRAY &&
+ if (!NIL_P(errat) && RB_TYPE_P(errat, T_ARRAY) &&
(bt2 = vm_backtrace(th, -2), RARRAY_LEN(bt2) > 0)) {
- if (!NIL_P(mesg) && TYPE(mesg) == T_STRING && !RSTRING_LEN(mesg)) {
+ if (!NIL_P(mesg) && RB_TYPE_P(mesg, T_STRING) && !RSTRING_LEN(mesg)) {
if (OBJ_FROZEN(mesg)) {
VALUE m = rb_str_cat(rb_str_dup(RARRAY_PTR(errat)[0]), ": ", 2);
rb_ivar_set(errinfo, id_mesg, rb_str_append(m, mesg));
@@ -1189,7 +1189,7 @@ rb_eval_cmd(VALUE cmd, VALUE arg, int level)
level = 4;
}
- if (TYPE(cmd) != T_STRING) {
+ if (!RB_TYPE_P(cmd, T_STRING)) {
PUSH_TAG();
rb_set_safe_level_force(level);
if ((state = EXEC_TAG()) == 0) {