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.
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
Keys+Values: accept multiple maps (vaargs) - Adding UniqKeys+UniqValues #503
Keys+Values: accept multiple maps (vaargs) - Adding UniqKeys+UniqValues #503
Changes from 14 commits
e06396b
9e13c9b
4ef8b77
cadc6ea
c662470
f966312
18b6dc9
005192a
f0b3328
3852729
d7ab831
f5741e7
515399a
9754040
e426cde
8a0ad18
7efe1b5
333ca37
368c1f7
3ce749f
e7746b7
2642e6d
954ebe8
d75619a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
may be more effective
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.
similarly
UniqValues
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.
with this version, the order is not guarantee
IMO, we would need a new helper (UniqKeysUnordered) ?
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.
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.
@ccoVeille why is this change much better ?? Not able to understand. Is using continue a better approach ??
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.
It's the logic of "leave early", it's for readability and maintainability.
First, here, it's simpler to read that when existing we skip, than reading than when no existing we have to do something.
The leave early concept is there to avoid big if branch.
Also, imagine you have an new condition in this loop
With your current code, it would lead to put an if in the if
So the code would be something like this
Here is the same code when applying leave early
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.
waaaooo this seems a very good explanation. Thank you making it soo clear