Repository navigation
refactor(macro): Use CHECK to replace dassert_f/dassert - #1205
Merged
Merged
Conversation
acelyc111
force-pushed
the
dassert_to_CHECK
branch
from
October 26, 2022 04:05
5671914 to
6d4fe80
Compare
acelyc111
marked this pull request as ready for review
October 26, 2022 04:30
foreverneverer
previously approved these changes
Oct 27, 2022
levy5307
reviewed
Oct 27, 2022
| fetch_and_dequeue_messages(ready_responses, true); | ||
| for (dsn::message_ex *m : ready_responses) { | ||
| dassert(m != nullptr, ""); | ||
| CHECK(m, ""); |
Contributor
There was a problem hiding this comment.
It's better to user m != nullptr for pointer
Member
Author
There was a problem hiding this comment.
Both are OK.
But in the future refactor, we are going to introduce CHECK_EQ and CHECK_NE, it's a bit of duplicate and strange if we judge the pointer like CHECK_NE(pointer, nullptr). I also consulted some other projects' habit, both styles are OK.
Member
Author
There was a problem hiding this comment.
Added a new macro CHECK_NOTNULL for pointers, similar to glog CHECK_NOTNULL
empiredan
reviewed
Oct 27, 2022
acelyc111
force-pushed
the
dassert_to_CHECK
branch
from
October 27, 2022 05:55
e089308 to
8317629
Compare
levy5307
approved these changes
Oct 27, 2022
empiredan
approved these changes
Oct 27, 2022
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#1204
CHECKCHECK_NOTNULLCHECKto replace part ofdassert_f, which are used to check a single conditionCHECKto replace part ofdassert, which are used to check a single condition. And update to usefmtstyleTODO: src/replica/mutation_log.cpp:970 should be fixed later