aboutsummaryrefslogtreecommitdiffstats
path: root/rational.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-24 02:45:12 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-24 02:45:12 +0000
commit4512f065f9d6425db97c23029895d8b0f1a57aa2 (patch)
tree7ebe91f50dcb997279cb20d46a7ae571c5254462 /rational.c
parent151fdd50fe1dcf7aadd170bad03a93e59015bc73 (diff)
downloadruby-4512f065f9d6425db97c23029895d8b0f1a57aa2.tar.gz
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
Diffstat (limited to 'rational.c')
-rw-r--r--rational.c2
1 files changed, 1 insertions, 1 deletions
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;
}
}