From e878df745ca89ecdb07090ad2bb99fd433dfc3a3 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 29 Dec 2012 12:22:01 +0000 Subject: use RB_TYPE_P * enumerator.c (enumerator_initialize), eval.c (rb_using_refinement), (add_activated_refinement), numeric.c (num_interval_step_size), parse.y (arg, match_op_gen, cond0), range.c (range_bsearch), vm_insnhelper.c (vm_get_iclass): use RB_TYPE_P() to optimize. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- numeric.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numeric.c') diff --git a/numeric.c b/numeric.c index 1447f2ff68..52e2c366ea 100644 --- a/numeric.c +++ b/numeric.c @@ -1800,7 +1800,7 @@ num_interval_step_size(VALUE from, VALUE to, VALUE step, int excl) result = delta / diff; return LONG2FIX(result >= 0 ? result + 1 : 0); } - else if (TYPE(from) == T_FLOAT || TYPE(to) == T_FLOAT || TYPE(step) == T_FLOAT) { + else if (RB_TYPE_P(from, T_FLOAT) || RB_TYPE_P(to, T_FLOAT) || RB_TYPE_P(step, T_FLOAT)) { double n = ruby_float_step_size(NUM2DBL(from), NUM2DBL(to), NUM2DBL(step), excl); if (isinf(n)) return DBL2NUM(n); -- cgit v1.2.3