chore: remove duplicates using the symmetric difference function - #14469
Merged
Merged
Conversation
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Emyrk
force-pushed
the
stevenmasley/organizations_query
branch
from
August 28, 2024 14:41
d3aa5c4 to
ccbe85e
Compare
Emyrk
force-pushed
the
stevenmasley/slice_unique
branch
from
August 28, 2024 14:41
5af8f78 to
1cc418c
Compare
Emyrk
force-pushed
the
stevenmasley/organizations_query
branch
from
August 28, 2024 14:44
ccbe85e to
bbcfc01
Compare
Emyrk
force-pushed
the
stevenmasley/slice_unique
branch
from
August 28, 2024 14:44
1cc418c to
0a49b38
Compare
Emyrk
marked this pull request as ready for review
August 28, 2024 14:46
Emyrk
force-pushed
the
stevenmasley/organizations_query
branch
from
August 28, 2024 16:22
bbcfc01 to
ba492b2
Compare
Emyrk
force-pushed
the
stevenmasley/slice_unique
branch
2 times, most recently
from
August 28, 2024 16:29
369b2dc to
2d5e40d
Compare
Emyrk
changed the base branch from
stevenmasley/organizations_query
to
graphite-base/14469
August 28, 2024 18:24
Emyrk
force-pushed
the
stevenmasley/slice_unique
branch
from
August 28, 2024 18:24
2d5e40d to
028476d
Compare
Emyrk
force-pushed
the
stevenmasley/slice_unique
branch
from
August 28, 2024 19:34
028476d to
6889229
Compare
johnstcn
reviewed
Aug 28, 2024
| cpy := make([]T, 0, len(a)) | ||
|
|
||
| for _, v := range a { | ||
| if ContainsCompare(cpy, v, equal) { |
Member
There was a problem hiding this comment.
Why the repeated iteration? Can you not just keep a map[T]struct{} around? Or are you trying to avoid the comparable constraint?
Member
Author
There was a problem hiding this comment.
I am trying to avoid the comparable constraint because the RBAC uses RoleIdentifier structs which are not comparable 😢.
Member
There was a problem hiding this comment.
Gotcha. We probably want to be careful that we don't use this for too large a slice then.
Member
Author
There was a problem hiding this comment.
Yea, atm the slices are in the order of 5-10 elements
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

Just limiting the diff of the giant organization sync PR.
The
SymmetricDifferenceFuncused to include duplicates, which was incorrect.