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

Merge if statement #4939

Merged
merged 1 commit into from
Oct 7, 2021
Merged

Conversation

S-H-GAMELINKS
Copy link
Contributor

set_namespace_path_i has these code.
But, using same returtn value.

    if (!rb_is_const_id(id)) {
        return ID_TABLE_CONTINUE;
    }
    if (!rb_namespace_p(value)) {
        return ID_TABLE_CONTINUE;
    }

I think better to merge if statement.

    if (!rb_is_const_id(id) || !rb_namespace_p(value)) {
        return ID_TABLE_CONTINUE;
    }

@ioquatix ioquatix merged commit 323e7a6 into ruby:master Oct 7, 2021
@ioquatix
Copy link
Member

ioquatix commented Oct 7, 2021

This looks good to me. The only logical reason that this would be done is if perhaps each block had a preceeding comment explaining the meaning of that particular condition. Or possibly before it was a more complex condition that was simplified.

@S-H-GAMELINKS S-H-GAMELINKS deleted the merge_if_statement branch October 7, 2021 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants