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 /variable.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 'variable.c')
-rw-r--r-- | variable.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/variable.c b/variable.c index 3909b799c4..ae89e8eead 100644 --- a/variable.c +++ b/variable.c @@ -161,7 +161,7 @@ classname(VALUE klass) else { path = (VALUE)n; } - if (TYPE(path) != T_STRING) { + if (!RB_TYPE_P(path, T_STRING)) { rb_bug("class path is not set properly"); } return path; @@ -199,7 +199,7 @@ rb_class_path(VALUE klass) else { const char *s = "Class"; - if (TYPE(klass) == T_MODULE) { + if (RB_TYPE_P(klass, T_MODULE)) { if (rb_obj_class(klass) == rb_cModule) { s = "Module"; } @@ -2157,7 +2157,7 @@ rb_mod_public_constant(int argc, VALUE *argv, VALUE obj) static VALUE original_module(VALUE c) { - if (TYPE(c) == T_ICLASS) + if (RB_TYPE_P(c, T_ICLASS)) return RBASIC(c)->klass; return c; } |