mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Refactor f_infinite_p function
This commit is contained in:
parent
afa4b59e06
commit
d1d76f2428
Notes:
git
2021-09-02 17:39:46 +09:00
1 changed files with 1 additions and 4 deletions
|
@ -354,15 +354,12 @@ VALUE rb_flo_is_infinite_p(VALUE num);
|
|||
inline static VALUE
|
||||
f_infinite_p(VALUE x)
|
||||
{
|
||||
if (RB_INTEGER_TYPE_P(x)) {
|
||||
if (RB_INTEGER_TYPE_P(x) || RB_TYPE_P(x, T_RATIONAL)) {
|
||||
return Qnil;
|
||||
}
|
||||
else if (RB_FLOAT_TYPE_P(x)) {
|
||||
return rb_flo_is_infinite_p(x);
|
||||
}
|
||||
else if (RB_TYPE_P(x, T_RATIONAL)) {
|
||||
return Qnil;
|
||||
}
|
||||
return rb_funcallv(x, id_infinite_p, 0, 0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue