-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
[Core] Replace ERR_FAIL_COND
with ERR_FAIL_NULL
where applicable
#81487
Conversation
b9e24ce
to
b4d5b5c
Compare
Going through various areas, can make a single massive PR for all the areas or split it into dedicated parts, will start by adding the individual commits to this and will split if required |
ERR_FAIL_COND
with ERR_FAIL_NULL
where applicableERR_FAIL_COND
with ERR_FAIL_NULL
where applicable
b4d5b5c
to
0382042
Compare
I think the advantage of But this advantage does not exist for |
The advantage is communication, it makes it clear what it checks for, see the case in the OP |
0382042
to
893f889
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good from a quick review. If I understand correctly, this won't compile if it's incorrect, so I think this is pretty safe.
Did some changes that I rolled back before which didn't show up until running (they were |
The remaining parts of the engine have the following sizes in changes:
Can combine as desired, the scan is the same so same considerations apply, servers is large, but also largely a simple pattern All were applied with a filter in Kate, and hand picked based on the names, and rolled back a few cases that were variant or bool |
Thanks! |
Thank you! |
The primary reason is plain correctness, but several of these cases, especially the wider cases that will be added soon, are hard to tell what they should be with the current code, so having an explicit null check makes reading the code easier
The most straight-forward argument, taken from
display_server_web.cpp
:And the one from
display_server_windows.cpp
:Only one is a null check, despite being entirely identical otherwise.
Edit: Also cleaned up some error messages for style when they were already part of the change.