-
Notifications
You must be signed in to change notification settings - Fork 473
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
Implement the ZADD options #1022
Conversation
72e0e1b
to
ac277a6
Compare
035955b
to
9ab913c
Compare
You can just run |
Oh, I notice the cppcheck false alarm. I think you can change |
got it,thanks. |
It seems cppcheck wrongly reports @PragmaTwice |
It is sad that cppcheck still fail and report a FALSE ALARM. We will replace cppcheck by clang-tidy later, and I think you can now workaround it by cc @git-hulk |
* Add mailing list to README * Update .asf.yaml * Update README.md Co-authored-by: tison <wander4096@gmail.com> Co-authored-by: tison <wander4096@gmail.com>
@manchurio Need to use gofmt to format the test case |
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.
If you only need to determine whether the key exists, you can use count directly, the iterator is redundant. Also doing this will not trigger an error from cppcheck. (By the way, C++20 has contains to do this thing. )
Hi @tanruixiang, Actually I like the original code more, since the iterator is used in the true-branch block to avoid a double search (the upper bound is actually not O(1) due to collision, and even O(1) DOES NOT imples no cost). And I think this change does not improve readability, as the use of iterators is natural and easy to understand in c++. The false positives of cppcheck are entirely due to his own problems, and we should not modify the code logic just for that. And in my opinion, I prefer just a comment rather than "request for changes" for just a trivial and purely code-smell review message, in order to be nice to new contributors. |
Got it, thanks a lot for your suggestion. It should be that I misunderstood this "request for changes". I originally thought that only use "request for changes" can be clicked on github to modify. (Because if someone else suggests a little modification, I prefer to click on github to complete the modification🤣) |
Maybe it's my bad habit, I always try not to use iterators in code snippets that are similar to algorithm problems. I will try to use iterators more in the future. |
In the github review page, you can select "comment", "request for changes" or "approve". I think the first option is relatively "milder". |
This refactoring has been completed |
@manchurio Thank you, I'll have a look at it as soon as possible. |
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.
Hi. Since there is a unified interface to get the flag's status, then we don't need additional variables to store. Even if there is reuse, there is no difference in speed.
c495d9b
to
d68479b
Compare
d68479b
to
7c7b604
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.
Overall is good for me, only one comment.
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.
LGTM
This reverts commit 30a0348.
Sorry, touched wrong button. 🤣 |
This closes #1018
Has passed the unit test with go.