Skip to content

Remove unnecessary null pointer checks (ASWF issue #257) #2046

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

epowers
Copy link

@epowers epowers commented May 16, 2025

Fix remove unnecessary set local variable to null before it immediately goes out of scope. N

Fix remove unnecessary null pointer checks, issue #257.

There only appeared to be one obvious case left.

Code search process:

grep -C 3 delete .

... then look for if statements, in C-like code, conditioned on the same variable, and no other obvious purpose that required the if statement.

See:

#257

Note: one of the two commits doesn't technically match the paradigm raised in the issue, but setting a pointer variable to nullptr immediately before it goes out of scope is unnecessary.

epowers added 2 commits May 16, 2025 12:44
…dation#257.

There only appeared to be one obvious case left.

Code search process:

    grep -C 3 delete .

... then look for if statements, in C-like code, conditioned on the same
variable, and no other obvious purpose that required the if statement.

Signed-off-by: Eric Powers <[email protected]>
@epowers epowers requested a review from kmuseth as a code owner May 16, 2025 21:41
Copy link

CLA Not Signed

@epowers
Copy link
Author

epowers commented May 16, 2025

CLA Not Signed...

working this internally...

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

Successfully merging this pull request may close these issues.

1 participant