aboutsummaryrefslogtreecommitdiffstats
path: root/numeric.c
diff options
context:
space:
mode:
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/numeric.c b/numeric.c
index 0061f089ab..990d792245 100644
--- a/numeric.c
+++ b/numeric.c
@@ -3252,14 +3252,12 @@ rb_int_odd_p(VALUE num)
if (num & 2) {
return Qtrue;
}
+ return Qfalse;
}
- else if (RB_TYPE_P(num, T_BIGNUM)) {
+ else {
+ assert(RB_TYPE_P(num, T_BIGNUM));
return rb_big_odd_p(num);
}
- else if (rb_funcall(num, '%', 1, INT2FIX(2)) != INT2FIX(0)) {
- return Qtrue;
- }
- return Qfalse;
}
/*
@@ -3276,14 +3274,12 @@ int_even_p(VALUE num)
if ((num & 2) == 0) {
return Qtrue;
}
+ return Qfalse;
}
- else if (RB_TYPE_P(num, T_BIGNUM)) {
+ else {
+ assert(RB_TYPE_P(num, T_BIGNUM));
return rb_big_even_p(num);
}
- else if (rb_funcall(num, '%', 1, INT2FIX(2)) == INT2FIX(0)) {
- return Qtrue;
- }
- return Qfalse;
}
/*