From 789853edc6cccf10487b23e7ad8db1e0a48b192d Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 24 Feb 2018 02:45:12 +0000 Subject: rational.c: removed needless calc * rational.c (read_num): exp(0) is 1, no need to multiply. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- rational.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rational.c') diff --git a/rational.c b/rational.c index b57677031d..010988f7e5 100644 --- a/rational.c +++ b/rational.c @@ -2437,7 +2437,7 @@ read_num(const char **s, const char *const end, VALUE *num, VALUE *div) *div = f_expt10(negate_num(exp)); } else { - *num = rb_int_mul(n, f_expt10(exp)); + if (exp != ZERO) *num = rb_int_mul(n, f_expt10(exp)); *div = ONE; } } -- cgit v1.2.3