Clarified about copying an immutable dictionary by WhiteBlackGoose · Pull Request #11877 · dotnet/dotnet-api-docs

Skip to content

Navigation Menu

Sign in

Appearance settings

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

@WhiteBlackGoose

Copy link

Contributor

Summary

I think saying that a copy is made is misleading, because it makes the person assume a copy of the whole dictionary is made, whereas in reality operations like Add are O(log(N)) complex.

@WhiteBlackGoose WhiteBlackGoose requested a review from a team as a code owner

October 2, 2025 19:20

@dotnet-policy-service dotnet-policy-service bot added the community-contribution

Indicates that the PR has been added by a community member

label

Oct 2, 2025

@dotnet-policy-service

Copy link

Contributor

Tagging subscribers to this area: @dotnet/area-system-collections


## Remarks
When you manipulate an immutable dictionary a copy of the original dictionary is made, manipulations applied and a new immutable dictionary is returned.
When you manipulate an immutable dictionary, a new one is returned with the appropriate changes, while the old one is not altered.
Copy link

Contributor Author

Choose a reason for hiding this comment

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

Alternatively, "a new instance"? Or even "a new instance if necessary"?

Copy link

Contributor Author

Choose a reason for hiding this comment

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

Alternatively: using the old wording but with "minimal copy" instead of "copy". Or "minimal (optimized) copy"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

area-System.Collections community-contribution

Indicates that the PR has been added by a community member

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@WhiteBlackGoose