Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
CyrusNajmabadi committed Aug 23, 2022
1 parent 099d4e0 commit 4ed3696
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ private static Task<SymbolTreeInfo> CreateMetadataSymbolTreeInfoAsync(
services,
solutionKey,
getChecksumAsync: () => new ValueTask<Checksum>(GetMetadataChecksum(services, reference, cancellationToken)),
createAsync: checksum => new ValueTask<SymbolTreeInfo>(CreateMetadataSymbolTreeInfo(checksum, reference)),
createAsync: checksum => new ValueTask<SymbolTreeInfo>(new MetadataInfoCreator(checksum, reference).Create()),
keySuffix: GetMetadataKeySuffix(reference),
cancellationToken);
}
Expand All @@ -200,13 +200,6 @@ public static Task<SymbolTreeInfo> 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<string> s_isNotNullOrEmpty = s => !string.IsNullOrEmpty(s);
Expand Down Expand Up @@ -760,7 +753,7 @@ private void AddUnsortedNodes(ArrayBuilder<BuilderNode> unsortedNodes,
}
}

private class MetadataNode
private sealed class MetadataNode
{
private static readonly ObjectPool<MetadataNode> s_pool = SharedPools.Default<MetadataNode>();

Expand Down

0 comments on commit 4ed3696

Please sign in to comment.