mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Remove unused else if statements in int_even_p func (#3220)
* remove else if & rb_funcall * fix int_even_p impl * fix rb_int_odd_p implementation
This commit is contained in:
parent
b877928ca5
commit
eaf76be087
Notes:
git
2020-06-17 02:14:33 +09:00
Merged-By: k0kubun <takashikkbn@gmail.com>
1 changed files with 6 additions and 10 deletions
16
numeric.c
16
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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue