提交 73285d29 编写于 作者: C CyrusNajmabadi

Use patterns in more places.

上级 324616d2
......@@ -72,19 +72,19 @@ public static SymbolKeyResolution Resolve(SymbolKeyReader reader)
private static IEnumerable<INamespaceSymbol> Resolve(ISymbol container, string metadataName)
{
if (container is IAssemblySymbol)
if (container is IAssemblySymbol assembly)
{
Debug.Assert(metadataName == string.Empty);
return SpecializedCollections.SingletonEnumerable(((IAssemblySymbol)container).GlobalNamespace);
return SpecializedCollections.SingletonEnumerable(assembly.GlobalNamespace);
}
else if (container is IModuleSymbol)
else if (container is IModuleSymbol module)
{
Debug.Assert(metadataName == string.Empty);
return SpecializedCollections.SingletonEnumerable(((IModuleSymbol)container).GlobalNamespace);
return SpecializedCollections.SingletonEnumerable(module.GlobalNamespace);
}
else if (container is INamespaceSymbol)
else if (container is INamespaceSymbol namespaceSymbol)
{
return ((INamespaceSymbol)container).GetMembers(metadataName).OfType<INamespaceSymbol>();
return namespaceSymbol.GetMembers(metadataName).OfType<INamespaceSymbol>();
}
else
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册