AddOrUpdate Method For Generics Dictionary #74812
-
If we have a generics dictionary and we want to We currently have to use Can we add a method "AddOrUpdate" to do the above logic in one call? |
Beta Was this translation helpful? Give feedback.
Replies: 0 comments 2 replies
-
dictionary[key] = value;
|
Beta Was this translation helpful? Give feedback.
-
This is a question for dotnet/runtime, where it was discussed a few times (#26848, #1221) and ended up being closed, pointing to |
Beta Was this translation helpful? Give feedback.
This is a question for dotnet/runtime, where it was discussed a few times (#26848, #1221) and ended up being closed, pointing to
CollectionsMarshal.GetValueRefOrAddDefault()
if you're looking for this method to improve performance.