mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
insns.def: RB_TYPE_P
* insns.def (checkincludearray, defineclass, opt_regexpmatch2): use RB_TYPE_P(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
dc54eeccc8
commit
c1ef657b39
1 changed files with 4 additions and 4 deletions
|
@ -553,7 +553,7 @@ checkincludearray
|
|||
int i;
|
||||
result = Qfalse;
|
||||
|
||||
if (TYPE(ary) != T_ARRAY) {
|
||||
if (!RB_TYPE_P(ary, T_ARRAY)) {
|
||||
ary = rb_Array(ary);
|
||||
}
|
||||
|
||||
|
@ -910,7 +910,7 @@ defineclass
|
|||
if ((klass = vm_search_const_defined_class(cbase, id)) != 0) {
|
||||
/* already exist */
|
||||
klass = define_type == 0 ? rb_public_const_get_at(klass, id) : rb_const_get_at(klass, id);
|
||||
if (TYPE(klass) != T_CLASS) {
|
||||
if (!RB_TYPE_P(klass, T_CLASS)) {
|
||||
rb_raise(rb_eTypeError, "%s is not a class", rb_id2name(id));
|
||||
}
|
||||
|
||||
|
@ -948,7 +948,7 @@ defineclass
|
|||
if ((klass = vm_search_const_defined_class(cbase, id)) != 0) {
|
||||
klass = define_type == 2 ? rb_public_const_get_at(klass, id) : rb_const_get_at(klass, id);
|
||||
/* already exist */
|
||||
if (TYPE(klass) != T_MODULE) {
|
||||
if (!RB_TYPE_P(klass, T_MODULE)) {
|
||||
rb_raise(rb_eTypeError, "%s is not a module", rb_id2name(id));
|
||||
}
|
||||
}
|
||||
|
@ -2093,7 +2093,7 @@ opt_regexpmatch2
|
|||
(VALUE obj2, VALUE obj1)
|
||||
(VALUE val)
|
||||
{
|
||||
if (TYPE(obj2) == T_STRING) {
|
||||
if (RB_TYPE_P(obj2, T_STRING)) {
|
||||
val = rb_reg_match(obj1, obj2);
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Reference in a new issue