summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-compiler/core
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2019-09-27 00:00:03 +0900
committerGitHub <[email protected]>2019-09-27 00:00:03 +0900
commit5cd6ed4511a0d8d5a19a0cd2beb4cdd97dc3eff5 (patch)
treeaed35130caaefda715f3db749a506f0bb0787090 /mrbgems/mruby-compiler/core
parentd4be545d54ad53e282637f66ef5b770b9effa918 (diff)
parentfeaf80d8996340bd0316fda72418b1abd774bd59 (diff)
downloadmruby-5cd6ed4511a0d8d5a19a0cd2beb4cdd97dc3eff5.tar.gz
mruby-5cd6ed4511a0d8d5a19a0cd2beb4cdd97dc3eff5.zip
Merge pull request #4733 from shuujii/use-type-predicate-macros-instead-of-mrb_type-if-possible
Use type predicate macros instead of `mrb_type` if possible
Diffstat (limited to 'mrbgems/mruby-compiler/core')
-rw-r--r--mrbgems/mruby-compiler/core/codegen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mrbgems/mruby-compiler/core/codegen.c b/mrbgems/mruby-compiler/core/codegen.c
index 1989c0cf1..0af76bd17 100644
--- a/mrbgems/mruby-compiler/core/codegen.c
+++ b/mrbgems/mruby-compiler/core/codegen.c
@@ -559,7 +559,7 @@ new_lit(codegen_scope *s, mrb_value val)
mrb_int len;
pv = &s->irep->pool[i];
- if (mrb_type(*pv) != MRB_TT_STRING) continue;
+ if (!mrb_string_p(*pv)) continue;
if ((len = RSTRING_LEN(*pv)) != RSTRING_LEN(val)) continue;
if (memcmp(RSTRING_PTR(*pv), RSTRING_PTR(val), len) == 0)
return i;
@@ -570,7 +570,7 @@ new_lit(codegen_scope *s, mrb_value val)
for (i=0; i<s->irep->plen; i++) {
mrb_float f1, f2;
pv = &s->irep->pool[i];
- if (mrb_type(*pv) != MRB_TT_FLOAT) continue;
+ if (!mrb_float_p(*pv)) continue;
f1 = mrb_float(*pv);
f2 = mrb_float(val);
if (f1 == f2 && !signbit(f1) == !signbit(f2)) return i;