summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-23 13:43:44 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-23 13:43:44 +0000
commit9662ee0584083d73c5e9a4aa6db13ed431df22e2 (patch)
treea334bf26a0d805579c0f19a7b309c9b43f904116 /class.c
parentc29ad01850a994bdc9d931b341fbb494de41fd21 (diff)
internal.h: inline Check_Type
* internal.h (Check_Type): inline check for the object type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r--class.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/class.c b/class.c
index 6b818a3..8ab496e 100644
--- a/class.c
+++ b/class.c
@@ -855,11 +855,7 @@ rb_include_module(VALUE klass, VALUE module)
int changed = 0;
rb_frozen_class_p(klass);
-
- if (!RB_TYPE_P(module, T_MODULE)) {
- Check_Type(module, T_MODULE);
- }
-
+ Check_Type(module, T_MODULE);
OBJ_INFECT(klass, module);
changed = include_modules_at(klass, RCLASS_ORIGIN(klass), module, TRUE);
@@ -971,9 +967,7 @@ rb_prepend_module(VALUE klass, VALUE module)
int changed = 0;
rb_frozen_class_p(klass);
-
Check_Type(module, T_MODULE);
-
OBJ_INFECT(klass, module);
origin = RCLASS_ORIGIN(klass);