Skip to content

Commit

Permalink
Refactor f_infinite_p function
Browse files Browse the repository at this point in the history
  • Loading branch information
S-H-GAMELINKS authored and nobu committed Sep 2, 2021
1 parent afa4b59 commit d1d76f2
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions complex.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit d1d76f2

Please sign in to comment.