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 forced override of package contents #1156

Merged
merged 4 commits into from
Aug 15, 2024

Conversation

sharwell
Copy link
Member

@sharwell sharwell commented Apr 8, 2024

Fixes #1155

@sharwell sharwell marked this pull request as ready for review April 9, 2024 17:58
@sharwell sharwell requested a review from a team as a code owner April 9, 2024 17:58
// is resolved.
if (Equals(GetFrameworkNameFromPath(assembliesByPrecedence[0]), GetFrameworkNameFromPath(assembliesByPrecedence[i])))
{
assembliesToRemove.Add(assembliesByPrecedence[i - 1]);

Choose a reason for hiding this comment

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

assembliesToRemove

Why not just directly remove from resolvedAssemblies?

Choose a reason for hiding this comment

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

(I assume it's the GroupBy usage, but if that were the case, I would have thought just realizing that result would have been easier)

Copy link
Member Author

Choose a reason for hiding this comment

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

➡️ I'm going to keep the current form for ease of debugging. Will add a comment in the code explaining that.

// In this example, the Microsoft.NETCore.App.Ref package is resolved first, so by taking
// the last net6.0 assembly, we ensure the assembly from System.Collections.Immutable 8.0.0
// is resolved.
if (Equals(GetFrameworkNameFromPath(assembliesByPrecedence[0]), GetFrameworkNameFromPath(assembliesByPrecedence[i])))
Copy link

@ToddGrun ToddGrun Aug 14, 2024

Choose a reason for hiding this comment

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

GetFrameworkNameFromPath(assembliesByPrecedence[0])

as this is invariant, consider moving it outside the loop

Copy link
Member Author

Choose a reason for hiding this comment

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

➡️ Moved to single evaluation of GetFrameworkNameFromPath

Copy link

@ToddGrun ToddGrun left a comment

Choose a reason for hiding this comment

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

:shipit:

@sharwell sharwell merged commit dda9795 into dotnet:main Aug 15, 2024
9 checks passed
@sharwell sharwell deleted the collections-8 branch August 15, 2024 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants