diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-08-01 22:29:26 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-08-01 22:29:26 +0000 |
commit | d28d075cc1a2907e2b9db0d37b52b1711c9097c3 (patch) | |
tree | af032fd69bfadd5be15bc1fb2c2015035ccec244 /vm_insnhelper.c | |
parent | 61b624d149204c2b1c17a2852d088b2eb2aa010b (diff) | |
download | ruby-d28d075cc1a2907e2b9db0d37b52b1711c9097c3.tar.gz |
RB_TYPE_P BUILTIN_TYPE
* string.c, vm_insnhelper.c, vm_method.c: use RB_TYPE_P() and
BUILTIN_TYPE() if possible.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 1b23ee6e18..074e24cd36 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -1175,11 +1175,7 @@ static inline void vm_check_if_namespace(VALUE klass) { VALUE str; - switch (TYPE(klass)) { - case T_CLASS: - case T_MODULE: - break; - default: + if (!RB_TYPE_P(klass, T_CLASS) && !RB_TYPE_P(klass, T_MODULE)) { str = rb_inspect(klass); rb_raise(rb_eTypeError, "%s is not a class/module", StringValuePtr(str)); |