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

remove redundant Distinct #1656

Closed

Conversation

SimonCropp
Copy link
Contributor

No description provided.

@josephdecock
Copy link
Member

I don't think we can prove with certainty that these calls to Distinct are always redundant. We also have merge conflicts here, and in the interest of trying to clear out all the PRs so that we can merge #1653, I'm just going to close this one.

@SimonCropp
Copy link
Contributor Author

@josephdecock they are being added to a hashset. so the distinct is redundant?

@josephdecock
Copy link
Member

josephdecock commented Dec 10, 2024

The AllowedAccessTokenSigningAlgorithms that this is called on is an ICollection<string> with a default value that is a HashSet, so while it is true that in the vast majority of cases the call is redundant, it is possible that some caller creates a different ICollection and then messes up by duplicating values in it.

@SimonCropp SimonCropp deleted the remove-redundant-Distinct branch December 10, 2024 06:01
@SimonCropp
Copy link
Contributor Author

i dont think so. the loop does a dictionary contains check on the type

@josephdecock
Copy link
Member

If you add a unit test that verifies that the results are distinct, then we can merge. But please hold off until after The Big Merge. Thanks!

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.

2 participants