summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2020-04-09 09:14:02 +0900
committerYusuke Endoh <mame@ruby-lang.org>2020-04-09 09:14:02 +0900
commit1a4f33e84e0633e8f953ee3cb06b42dcc952444a (patch)
tree18017ab2feae6b29c135286ec8a2037f50e7b00b /numeric.c
parentcdd613b2997944cd0d82f8d41071440779c19a99 (diff)
numeric.c: Remove unreachable code
b cannot be <= 0 here. Found by Coverity Scan
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/numeric.c b/numeric.c
index 40a381f70f..e0729a284e 100644
--- a/numeric.c
+++ b/numeric.c
@@ -4079,10 +4079,7 @@ fix_pow(VALUE x, VALUE y)
if (b == 0) return INT2FIX(1);
if (b == 1) return x;
- if (a == 0) {
- if (b > 0) return INT2FIX(0);
- return DBL2NUM(HUGE_VAL);
- }
+ if (a == 0) return INT2FIX(0);
return int_pow(a, b);
}
else if (RB_TYPE_P(y, T_BIGNUM)) {