Using UNDEF_P macro

This commit is contained in:
S-H-GAMELINKS 2022-11-15 13:24:08 +09:00 committed by Nobuyoshi Nakada
parent dc1c4e4675
commit 1f4f6c9832
Notes: git 2022-11-16 09:58:53 +00:00
44 changed files with 290 additions and 290 deletions

View file

@ -743,7 +743,7 @@ w_ivar(st_index_t num, VALUE ivobj, VALUE encname, struct dump_call_arg *arg)
w_object(Qtrue, arg->arg, limit);
num--;
}
if (ivobj != Qundef && num) {
if (!UNDEF_P(ivobj) && num) {
w_ivar_each(ivobj, num, arg);
}
}
@ -930,7 +930,7 @@ w_object(VALUE obj, struct dump_arg *arg, int limit)
arg->compat_tbl = rb_init_identtable();
}
st_insert(arg->compat_tbl, (st_data_t)obj, (st_data_t)real_obj);
if (obj != real_obj && ivobj == Qundef) hasiv = 0;
if (obj != real_obj && UNDEF_P(ivobj)) hasiv = 0;
}
}
if (hasiv) w_byte(TYPE_IVAR, arg);
@ -2251,7 +2251,7 @@ r_object_for(struct load_arg *arg, bool partial, int *ivp, VALUE extmod, int typ
break;
}
if (v == Qundef) {
if (UNDEF_P(v)) {
rb_raise(rb_eArgError, "dump format error (bad link)");
}