summaryrefslogtreecommitdiff
path: root/range.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-29 12:22:01 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-29 12:22:01 +0000
commite878df745ca89ecdb07090ad2bb99fd433dfc3a3 (patch)
treef19ee613be1c68c4167b2b34415543bfa5c4e4a5 /range.c
parenteb56c1084d57e59b9daab78b22812660d890a354 (diff)
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
Diffstat (limited to 'range.c')
-rw-r--r--range.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/range.c b/range.c
index 43c3389..4f75789 100644
--- a/range.c
+++ b/range.c
@@ -580,7 +580,7 @@ range_bsearch(VALUE range)
if (!satisfied) return Qnil;
return INT2FIX(low);
}
- else if (TYPE(beg) == T_FLOAT || TYPE(end) == T_FLOAT) {
+ else if (RB_TYPE_P(beg, T_FLOAT) || RB_TYPE_P(end, T_FLOAT)) {
double low = RFLOAT_VALUE(rb_Float(beg));
double high = RFLOAT_VALUE(rb_Float(end));
double mid, org_high;