1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Reuse RBOOL macro in rb_ivar_defined function

This commit is contained in:
S-H-GAMELINKS 2022-10-24 16:31:07 +09:00 committed by Jean Boussier
parent 87f432b675
commit 298221dfe5
Notes: git 2022-10-24 08:25:24 +00:00

View file

@ -1594,12 +1594,7 @@ rb_ivar_defined(VALUE obj, ID id)
switch (BUILTIN_TYPE(obj)) {
case T_CLASS:
case T_MODULE:
if (RCLASS_IV_TBL(obj) && lock_st_is_member(RCLASS_IV_TBL(obj), (st_data_t)id)) {
return Qtrue;
}
else {
return Qfalse;
}
return RBOOL(RCLASS_IV_TBL(obj) && lock_st_is_member(RCLASS_IV_TBL(obj), (st_data_t)id));
default:
return RBOOL(rb_shape_get_iv_index(rb_shape_get_shape(obj), id, &index));
}