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

Remove extra Null Check from NoteRequestResponse #156

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

gwolffblues
Copy link
Contributor

The NoteRequestResponse function checks the response to NoteTransaction for a NULL value.

The code in the IF branch of the check end outside the branch perform the exact same operations, except for explicitly returning NULL instead of the value of the rsp. Except we already know rsp is NULL, otherwise we wouldn't be in this branch.

Removing this check does not change behavior of NoteRequestResponse nor impact calling functions, as the return values remain the same.

@gwolffblues gwolffblues requested a review from zfields September 10, 2024 18:44
Copy link
Collaborator

@zfields zfields left a comment

Choose a reason for hiding this comment

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

Good find! Love to eliminate unnecessary code paths. 🎉

@zfields zfields merged commit dcbffb2 into master Sep 11, 2024
8 of 9 checks passed
@zfields zfields deleted the remove_extra_null_check branch September 11, 2024 14:16
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.

2 participants