Reuse RBOOL macro in rb_ivar_defined function
This commit is contained in:
parent
87f432b675
commit
298221dfe5
Notes:
git
2022-10-24 08:25:24 +00:00
@ -1594,12 +1594,7 @@ rb_ivar_defined(VALUE obj, ID id)
|
|||||||
switch (BUILTIN_TYPE(obj)) {
|
switch (BUILTIN_TYPE(obj)) {
|
||||||
case T_CLASS:
|
case T_CLASS:
|
||||||
case T_MODULE:
|
case T_MODULE:
|
||||||
if (RCLASS_IV_TBL(obj) && lock_st_is_member(RCLASS_IV_TBL(obj), (st_data_t)id)) {
|
return RBOOL(RCLASS_IV_TBL(obj) && lock_st_is_member(RCLASS_IV_TBL(obj), (st_data_t)id));
|
||||||
return Qtrue;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return Qfalse;
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
return RBOOL(rb_shape_get_iv_index(rb_shape_get_shape(obj), id, &index));
|
return RBOOL(rb_shape_get_iv_index(rb_shape_get_shape(obj), id, &index));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user