diff --git a/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs b/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs index d6070403001e2..a7f879ba4dd68 100644 --- a/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs +++ b/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine.cs @@ -88,13 +88,13 @@ private async Task PerformSearchAsync( // // This is a normal dictionary that is not locked. It is only ever read and written to serially from within the // high level project-walking code in this method. - var symbolToGroup = new Dictionary(MetadataUnifyingEquivalenceComparer.Instance); + using var _1 = s_symbolToGroupPool.GetPooledObject(out var symbolToGroup); var unifiedSymbols = new MetadataUnifyingSymbolHashSet(); unifiedSymbols.AddRange(symbols); var disposable = await _progressTracker.AddSingleItemAsync(cancellationToken).ConfigureAwait(false); - await using var _ = disposable.ConfigureAwait(false); + await using var _2 = disposable.ConfigureAwait(false); // Create the initial set of symbols to search for. As we walk the appropriate projects in the solution // we'll expand this set as we discover new symbols to search for in each project. diff --git a/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine_FindReferencesInDocuments.cs b/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine_FindReferencesInDocuments.cs index ccbb11e3cf36d..18345b5713bef 100644 --- a/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine_FindReferencesInDocuments.cs +++ b/src/Workspaces/Core/Portable/FindSymbols/FindReferences/FindReferencesSearchEngine_FindReferencesInDocuments.cs @@ -32,7 +32,7 @@ public async Task FindReferencesInDocumentsAsync( // // This is a normal dictionary that is not locked. It is only ever read and written to serially from within the // high level project-walking code in this method. - var symbolToGroup = new Dictionary(MetadataUnifyingEquivalenceComparer.Instance); + using var _ = s_symbolToGroupPool.GetPooledObject(out var symbolToGroup); var unifiedSymbols = new MetadataUnifyingSymbolHashSet {