Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor f_infinite_p function #4794

Merged
merged 1 commit into from
Sep 2, 2021

Conversation

S-H-GAMELINKS
Copy link
Contributor

@S-H-GAMELINKS S-H-GAMELINKS commented Sep 1, 2021

f_infinite_p function is implemented these code.

inline static VALUE
f_infinite_p(VALUE x)
{
    if (RB_INTEGER_TYPE_P(x)) {
        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);
}

RB_INTEGER_TYPE_P(x) or RB_TYPE_P(x, T_RATIONAL) statement return Qnil.
So, these statements can marged.

@duerst
Copy link
Member

duerst commented Sep 1, 2021

"So, these statement can be marged" -> "So, these statements can be merged."

@nobu nobu merged commit d1d76f2 into ruby:master Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants