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`). --- mrbgems/mruby-random/src/random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mrbgems/mruby-random') diff --git a/mrbgems/mruby-random/src/random.c b/mrbgems/mruby-random/src/random.c index af9876ce7..515c0707a 100644 --- a/mrbgems/mruby-random/src/random.c +++ b/mrbgems/mruby-random/src/random.c @@ -136,7 +136,7 @@ get_opt(mrb_state* mrb) static void random_check(mrb_state *mrb, mrb_value random) { struct RClass *c = mrb_class_get(mrb, "Random"); - if (!mrb_obj_is_kind_of(mrb, random, c) || mrb_type(random) != MRB_TT_ISTRUCT) { + if (!mrb_obj_is_kind_of(mrb, random, c) || !mrb_istruct_p(random)) { mrb_raise(mrb, E_TYPE_ERROR, "Random instance required"); } } -- cgit v1.2.3