summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-random/src/random.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 /mrbgems/mruby-random/src/random.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 'mrbgems/mruby-random/src/random.c')
-rw-r--r--mrbgems/mruby-random/src/random.c2
1 files changed, 1 insertions, 1 deletions
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");
}
}