Avoid closure when using ConcurrentDictionary
ProprietaryConcurrentDictionary methods like GetOrAdd may evaluate the factory even when the key exists. Use the overload with a factory argument to avoid closure allocation.
OpenRewrite. Recipes. CSharp. CodeQuality. Performance. FindAvoidClosureInConcurrentDictionarymod run . --recipe= OpenRewrite. Recipes. CSharp. CodeQuality. Performance. FindAvoidClosureInConcurrentDictionaryInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.