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:
parent
87f432b675
commit
298221dfe5
Notes:
git
2022-10-24 08:25:24 +00:00
1 changed files with 1 additions and 6 deletions
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue