summaryrefslogtreecommitdiff
path: root/vm_method.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_method.c
parent68f97d7851481e11ce90bb349345dc4caed00cf7 (diff)
downloadruby-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 'vm_method.c')
-rw-r--r--vm_method.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/vm_method.c b/vm_method.c
index d6c4926e65..f1235dcd47 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -521,7 +521,7 @@ rb_export_method(VALUE klass, ID name, rb_method_flag_t noex)
}
me = search_method(klass, name);
- if (!me && TYPE(klass) == T_MODULE) {
+ if (!me && RB_TYPE_P(klass, T_MODULE)) {
me = search_method(rb_cObject, name);
}
@@ -639,7 +639,7 @@ rb_undef(VALUE klass, ID id)
s0 = "";
}
}
- else if (TYPE(c) == T_MODULE) {
+ else if (RB_TYPE_P(c, T_MODULE)) {
s0 = " module";
}
rb_name_error(id, "undefined method `%s' for%s `%s'",
@@ -922,7 +922,7 @@ rb_alias(VALUE klass, ID name, ID def)
orig_me = search_method(klass, def);
if (UNDEFINED_METHOD_ENTRY_P(orig_me)) {
- if ((TYPE(klass) != T_MODULE) ||
+ if ((!RB_TYPE_P(klass, T_MODULE)) ||
(orig_me = search_method(rb_cObject, def), UNDEFINED_METHOD_ENTRY_P(orig_me))) {
rb_print_undef(klass, def, 0);
}
@@ -1176,7 +1176,7 @@ rb_mod_modfunc(int argc, VALUE *argv, VALUE module)
ID id;
const rb_method_entry_t *me;
- if (TYPE(module) != T_MODULE) {
+ if (!RB_TYPE_P(module, T_MODULE)) {
rb_raise(rb_eTypeError, "module_function must be called for modules");
}