From 4ed3696538554e8e10234d84ceff074b0518a200 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Mon, 22 Aug 2022 21:38:15 -0700 Subject: [PATCH] Simplify --- .../FindSymbols/SymbolTree/SymbolTreeInfo_Metadata.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/Workspaces/Core/Portable/FindSymbols/SymbolTree/SymbolTreeInfo_Metadata.cs b/src/Workspaces/Core/Portable/FindSymbols/SymbolTree/SymbolTreeInfo_Metadata.cs index 8bbc204f0c571..72df9c0e86374 100644 --- a/src/Workspaces/Core/Portable/FindSymbols/SymbolTree/SymbolTreeInfo_Metadata.cs +++ b/src/Workspaces/Core/Portable/FindSymbols/SymbolTree/SymbolTreeInfo_Metadata.cs @@ -176,7 +176,7 @@ private static Task CreateMetadataSymbolTreeInfoAsync( services, solutionKey, getChecksumAsync: () => new ValueTask(GetMetadataChecksum(services, reference, cancellationToken)), - createAsync: checksum => new ValueTask(CreateMetadataSymbolTreeInfo(checksum, reference)), + createAsync: checksum => new ValueTask(new MetadataInfoCreator(checksum, reference).Create()), keySuffix: GetMetadataKeySuffix(reference), cancellationToken); } @@ -200,13 +200,6 @@ public static Task LoadAnyInfoForMetadataReferenceAsync( cancellationToken); } - private static SymbolTreeInfo CreateMetadataSymbolTreeInfo( - Checksum checksum, PortableExecutableReference reference) - { - var creator = new MetadataInfoCreator(checksum, reference); - return creator.Create(); - } - private struct MetadataInfoCreator : IDisposable { private static readonly Predicate s_isNotNullOrEmpty = s => !string.IsNullOrEmpty(s); @@ -760,7 +753,7 @@ private void AddUnsortedNodes(ArrayBuilder unsortedNodes, } } - private class MetadataNode + private sealed class MetadataNode { private static readonly ObjectPool s_pool = SharedPools.Default();