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 mutable state from rename #65848

Merged
merged 8 commits into from
Dec 9, 2022

Conversation

CyrusNajmabadi
Copy link
Member

Was finding these mutable fields very confusing for determining what was going on in rename as i work on shared syntax trees. So pulled out this PR to clean it up.

@@ -118,6 +114,8 @@ public async Task<MutableConflictResolution> ResolveConflictsAsync()
var intermediateSolution = conflictResolution.OldSolution;
foreach (var documentsByProject in documentsGroupedByTopologicallySortedProjectId)
{
var conflictLocations = SpecializedCollections.EmptySet<ConflictLocationInfo>();
Copy link
Member Author

Choose a reason for hiding this comment

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

conflict locations is fresh for each project we look at. we know that because in phase-0, we always assign over whatever the prior project computed. so this just makes things simpler here.

@CyrusNajmabadi CyrusNajmabadi merged commit 8c2f046 into dotnet:main Dec 9, 2022
@ghost ghost added this to the Next milestone Dec 9, 2022
@CyrusNajmabadi CyrusNajmabadi deleted the renameCleanup branch December 9, 2022 02:43
{
try
{
var documentIds = new HashSet<DocumentId>();
Copy link
Member

Choose a reason for hiding this comment

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

Is it faster to use an ImmutableHashSet builder here?

{
try
{
var documentIds = new HashSet<DocumentId>();
var possibleNameConflictsList = new List<string>();
Copy link
Member

Choose a reason for hiding this comment

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

Ditto: immutable array builder?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants