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

Break after the first equals result_value to avoid duplicates #29

Merged
merged 3 commits into from
Mar 14, 2022

Conversation

gkorland
Copy link

@gkorland gkorland requested a review from oshadmi March 14, 2022 13:53
@gkorland gkorland requested a review from MeirShpilraien March 14, 2022 14:40
@gkorland gkorland merged commit 6da271e into generic_json_path Mar 14, 2022
@gkorland gkorland deleted the gkorland-duplicate branch March 14, 2022 14:59
@@ -168,6 +168,7 @@ where
for result_value in &ret {
if (*map_value).eq(*result_value) {
tmp.push(*rel_value);
break;
Copy link

Choose a reason for hiding this comment

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

Can use a label to break from the outer loop to get to the next rel_value?

'outer: for map_value in map.values() {
    for result_value in &ret {
        if map_value.eq(*result_value) {
            tmp.push(*rel_value);
            break 'outer;
        }
    }
}

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.

3 participants