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

Improve use of Ref.is_null/valid #100776

Merged
merged 1 commit into from
Dec 29, 2024

Conversation

AThousandShips
Copy link
Member

Use is_null over !is_valid and vice versa.

See:

Use `is_null` over `!is_valid` and vice versa.
Copy link
Contributor

@Mickeon Mickeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh my goodness that's a lot.

context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/run_file"), FILE_RUN);
context_menu->add_separator();
}
if (scr.is_valid() && scr->is_tool()) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Collapsed this as it was just redundant, cause if the mismatch of +/-

@Repiteo Repiteo modified the milestones: 4.x, 4.4 Dec 24, 2024
Copy link
Contributor

@Repiteo Repiteo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Repiteo Repiteo merged commit a9b6b3d into godotengine:master Dec 29, 2024
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Dec 29, 2024

Thanks!

@AThousandShips AThousandShips deleted the improve_null_checks branch December 29, 2024 16:31
@AThousandShips
Copy link
Member Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants