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

Implement ValueBuilder types for immutable collections #62193

Merged
merged 4 commits into from
Mar 21, 2024

Conversation

sharwell
Copy link
Member

Avoids Builder allocations for common mutations of immutable data structures.


internal SegmentedDictionary<TKey, TValue> ReadOnlyDictionary => _mutableDictionary ?? _dictionary._dictionary;

IEnumerable<TKey> IReadOnlyDictionary<TKey, TValue>.Keys => throw new NotSupportedException();
Copy link
Member Author

Choose a reason for hiding this comment

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

📝 It would be preferable for Keys and Values to work, but I couldn't think of a clean way for that to happen

Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@ToddGrun
Copy link
Contributor

ToddGrun commented Feb 27, 2024

I assume this branch is based off an extremely old main. Probably not a lot of changes in this area, but it might make it easier for me to try this out if it were rebased off current #Closed

@sharwell
Copy link
Member Author

sharwell commented Feb 27, 2024

I assume this branch is based off an extremely old main. Probably not a lot of changes in this area, but it might make it easier for me to try this out if it were rebased off current

Not planning to rebase as there are no conflicts, and the current head accurately reflects when the work was completed. You can check out commit refs/pull/62193/merge to test locally, though this would likely not be particularly informative.

Copy link
Contributor

@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
Copy link
Member Author

sharwell commented Mar 7, 2024

@dotnet/roslyn-compiler for reviews

2 similar comments
@sharwell
Copy link
Member Author

@dotnet/roslyn-compiler for reviews

@sharwell
Copy link
Member Author

@dotnet/roslyn-compiler for reviews

@sharwell
Copy link
Member Author

Rebased without changes (https://github.com/dotnet/roslyn/compare/7fea68830f7ef10a5e7e890431e1869d1c9a074d..b3e8dffce55f0f39b0644dec098c7d2c02591a54) to apply fixup commits, then merged main to fix conflicts.

@sharwell sharwell merged commit dac9da0 into dotnet:main Mar 21, 2024
30 checks passed
@sharwell sharwell deleted the value-builder branch March 21, 2024 23:12
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Mar 21, 2024
@RikkiGibson RikkiGibson modified the milestones: Next, 17.10 P3 Mar 25, 2024
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.

5 participants