Small improvements for mrb_gc_register()

The `mrb_nil_p()` used in conditional expressions is semantically included in `!mrb_array_p()`.
This commit is contained in:
dearblue
2024-10-19 10:59:21 +09:00
parent c3be2568ea
commit b28d53bda9
+1 -1
View File
@@ -431,7 +431,7 @@ mrb_gc_register(mrb_state *mrb, mrb_value obj)
table = mrb_gv_get(mrb, GC_ROOT_SYM);
int ai = mrb_gc_arena_save(mrb);
mrb_gc_protect(mrb, obj);
if (mrb_nil_p(table) || !mrb_array_p(table)) {
if (!mrb_array_p(table)) {
table = mrb_ary_new(mrb);
mrb_gv_set(mrb, GC_ROOT_SYM, table);
}