From feaf80d8996340bd0316fda72418b1abd774bd59 Mon Sep 17 00:00:00 2001 From: KOBAYASHI Shuji Date: Thu, 26 Sep 2019 22:23:27 +0900 Subject: 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`). --- src/state.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/state.c') diff --git a/src/state.c b/src/state.c index 99b523dd5..3e5ebb483 100644 --- a/src/state.c +++ b/src/state.c @@ -119,12 +119,12 @@ mrb_irep_free(mrb_state *mrb, mrb_irep *irep) if (!(irep->flags & MRB_ISEQ_NO_FREE)) mrb_free(mrb, (void*)irep->iseq); if (irep->pool) for (i=0; iplen; i++) { - if (mrb_type(irep->pool[i]) == MRB_TT_STRING) { + if (mrb_string_p(irep->pool[i])) { mrb_gc_free_str(mrb, RSTRING(irep->pool[i])); mrb_free(mrb, mrb_obj_ptr(irep->pool[i])); } #if defined(MRB_WORD_BOXING) && !defined(MRB_WITHOUT_FLOAT) - else if (mrb_type(irep->pool[i]) == MRB_TT_FLOAT) { + else if (mrb_float_p(irep->pool[i])) { mrb_free(mrb, mrb_obj_ptr(irep->pool[i])); } #endif -- cgit v1.2.3