Unverified Commit 96ce4563 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4614 from shuujii/use-mrb_int-instead-of-to_int-in-mruby-numeric-ext

Use `mrb_int()` instead of `to_int()` in `mruby-numeric-ext`
parents 0e2e8b79 d599e35a
......@@ -2,13 +2,6 @@
#include <mruby.h>
#include <mruby/numeric.h>
static inline mrb_int
to_int(mrb_state *mrb, mrb_value x)
{
x = mrb_to_int(mrb, x);
return mrb_fixnum(x);
}
/*
* call-seq:
* int.allbits?(mask) -> true or false
......@@ -21,7 +14,7 @@ mrb_int_allbits(mrb_state *mrb, mrb_value self)
mrb_int n, m;
mrb_get_args(mrb, "i", &m);
n = to_int(mrb, self);
n = mrb_int(mrb, self);
return mrb_bool_value((n & m) == m);
}
......@@ -37,7 +30,7 @@ mrb_int_anybits(mrb_state *mrb, mrb_value self)
mrb_int n, m;
mrb_get_args(mrb, "i", &m);
n = to_int(mrb, self);
n = mrb_int(mrb, self);
return mrb_bool_value((n & m) != 0);
}
......@@ -53,7 +46,7 @@ mrb_int_nobits(mrb_state *mrb, mrb_value self)
mrb_int n, m;
mrb_get_args(mrb, "i", &m);
n = to_int(mrb, self);
n = mrb_int(mrb, self);
return mrb_bool_value((n & m) == 0);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment