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

[Scene] Use NULL instead of COND checks when appropriate #77945

Merged
merged 1 commit into from
Jun 10, 2023

Conversation

AThousandShips
Copy link
Member

@AThousandShips AThousandShips commented Jun 7, 2023

Restricted to scene (it was enough work there, will expand in a later PR)

Tried to get everything but might have missed some

@AThousandShips AThousandShips requested review from a team as code owners June 7, 2023 07:47
@Chaosus Chaosus added this to the 4.1 milestone Jun 7, 2023
Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

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

Looks fine.
NULL is better than COND, because it provides better default message. It doesn't really matter when used with MSG.

@AThousandShips
Copy link
Member Author

I agree, but I'd argue that when the context isn't obvious (though most cases here are, as they were the easiest to just search/replace) I find that the type of the check helps with readability of the code, when it's a member variable

@akien-mga akien-mga merged commit 65969dd into godotengine:master Jun 10, 2023
@akien-mga
Copy link
Member

Thanks!

@AThousandShips
Copy link
Member Author

Thank you!

@AThousandShips AThousandShips deleted the null_check branch June 10, 2023 10:13
@AThousandShips AThousandShips changed the title Use NULL instead of COND checks when appropriate [Scene] Use NULL instead of COND checks when appropriate Sep 9, 2023
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.

4 participants