microsoft/dotnet-apiport

Clean up locks in DependencyFinderEngine.cs

Lxiamail opened this issue · 1 comments

  1. DependencyFinderEngine.cs#L65 and DependencyFinderEngine.cs#L110: Consider using the overload of AddOrUpdate that takes a factory for the initial value as well, to avoid allocating the HashSet whether you use it or not.
  2. DependencyFinderEngine.cs#L78 and DependencyFinderEngine.cs#L114: Consider removing this lock. ConcurrentDictionary ensures that updates to the values done in the factories are "atomic".

Reference to PR review comments at #809

Closing as API Port was deprecated in favor of binary analysis in .NET Upgrade Assistant.