mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
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`).
This commit is contained in:
@@ -65,7 +65,7 @@ mrb_ary_rassoc(mrb_state *mrb, mrb_value ary)
|
||||
|
||||
for (i = 0; i < RARRAY_LEN(ary); ++i) {
|
||||
v = RARRAY_PTR(ary)[i];
|
||||
if (mrb_type(v) == MRB_TT_ARRAY &&
|
||||
if (mrb_array_p(v) &&
|
||||
RARRAY_LEN(v) > 1 &&
|
||||
mrb_equal(mrb, RARRAY_PTR(v)[1], value))
|
||||
return v;
|
||||
|
||||
Reference in New Issue
Block a user