diff options
| author | KOBAYASHI Shuji <[email protected]> | 2019-09-26 22:23:27 +0900 |
|---|---|---|
| committer | KOBAYASHI Shuji <[email protected]> | 2019-09-26 22:23:27 +0900 |
| commit | feaf80d8996340bd0316fda72418b1abd774bd59 (patch) | |
| tree | 43801fcc666b937f60086b0d51271bb28eab1cc0 /src/state.c | |
| parent | 60cc46a92cf93f408dac22658c6a206e882e0e04 (diff) | |
| download | mruby-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/state.c')
| -rw-r--r-- | src/state.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; i<irep->plen; 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 |
