From 015d05c6e6e63104f5e9653663a6011684303cdf Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 26 May 2017 17:11:15 +0000 Subject: [PATCH] numeric.c: remove duplicate code * numeric.c (flo_to_i): use dbl2ival and reduce duplicate code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- numeric.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/numeric.c b/numeric.c index 8205829f8d..be4b729904 100644 --- a/numeric.c +++ b/numeric.c @@ -2324,16 +2324,11 @@ static VALUE flo_to_i(VALUE num) { double f = RFLOAT_VALUE(num); - long val; if (f > 0.0) f = floor(f); if (f < 0.0) f = ceil(f); - if (!FIXABLE(f)) { - return rb_dbl2big(f); - } - val = (long)f; - return LONG2FIX(val); + return dbl2ival(f); } /*