1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2018-02-24 02:45:12 +00:00
parent f954caea43
commit 789853edc6

View file

@ -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;
}
}