summaryrefslogtreecommitdiffhomepage
path: root/src/gc.c
diff options
context:
space:
mode:
authorKOBAYASHI Shuji <[email protected]>2019-09-26 22:23:27 +0900
committerKOBAYASHI Shuji <[email protected]>2019-09-26 22:23:27 +0900
commitfeaf80d8996340bd0316fda72418b1abd774bd59 (patch)
tree43801fcc666b937f60086b0d51271bb28eab1cc0 /src/gc.c
parent60cc46a92cf93f408dac22658c6a206e882e0e04 (diff)
downloadmruby-feaf80d8996340bd0316fda72418b1abd774bd59.tar.gz
mruby-feaf80d8996340bd0316fda72418b1abd774bd59.zip
Use type predicate macros instead of `mrb_type` if possible
For efficiency with `MRB_WORD_BOXING` (implement type predicate macros for all `enum mrb_vtype`).
Diffstat (limited to 'src/gc.c')
-rw-r--r--src/gc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gc.c b/src/gc.c
index a2a904477..835d1c61d 100644
--- a/src/gc.c
+++ b/src/gc.c
@@ -479,7 +479,7 @@ mrb_gc_register(mrb_state *mrb, mrb_value obj)
if (mrb_immediate_p(obj)) return;
root = mrb_intern_lit(mrb, GC_ROOT_NAME);
table = mrb_gv_get(mrb, root);
- if (mrb_nil_p(table) || mrb_type(table) != MRB_TT_ARRAY) {
+ if (mrb_nil_p(table) || !mrb_array_p(table)) {
table = mrb_ary_new(mrb);
mrb_gv_set(mrb, root, table);
}
@@ -499,7 +499,7 @@ mrb_gc_unregister(mrb_state *mrb, mrb_value obj)
root = mrb_intern_lit(mrb, GC_ROOT_NAME);
table = mrb_gv_get(mrb, root);
if (mrb_nil_p(table)) return;
- if (mrb_type(table) != MRB_TT_ARRAY) {
+ if (!mrb_array_p(table)) {
mrb_gv_set(mrb, root, mrb_nil_value());
return;
}