diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-07-08 18:40:13 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-07-13 12:54:02 +0900 |
| commit | 6b1cc6e2fe4eab30e265d8209a208e0bf942c54d (patch) | |
| tree | ebf2820aa36591f54bcbbb44b5310ec59b18ba88 /src/numeric.c | |
| parent | c902e304949d7ad7cc69a9ab8ba0c8bb62c325b7 (diff) | |
| download | mruby-6b1cc6e2fe4eab30e265d8209a208e0bf942c54d.tar.gz mruby-6b1cc6e2fe4eab30e265d8209a208e0bf942c54d.zip | |
Avoid `mrb_funcall()` if possible using `mrb_Float()`; ref #4555
Diffstat (limited to 'src/numeric.c')
| -rw-r--r-- | src/numeric.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/numeric.c b/src/numeric.c index 0d1c23589..4288df44a 100644 --- a/src/numeric.c +++ b/src/numeric.c @@ -172,17 +172,17 @@ integral_div(mrb_state *mrb, mrb_value x) static mrb_value integral_coerce_step_counter(mrb_state *mrb, mrb_value self) { - mrb_value counter = self, num, step; + mrb_value num, step; mrb_get_args(mrb, "oo", &num, &step); #ifndef MRB_WITHOUT_FLOAT if (mrb_float_p(self) || mrb_float_p(num) || mrb_float_p(step)) { - counter = mrb_funcall(mrb, counter, "to_f", 0); + return mrb_Float(mrb, self); } #endif - return counter; + return self; } #ifndef MRB_WITHOUT_FLOAT |
