提交 11ab6fcd 编写于 作者: C Cyrus Najmabadi

Use pattern matching

上级 233ff8d5
......@@ -90,8 +90,7 @@ protected override bool CanAddImport(SyntaxNode node, CancellationToken cancella
return false;
}
var method = parent.Expression as MemberAccessExpressionSyntax;
if (method != null)
if (parent.Expression is MemberAccessExpressionSyntax method)
{
node = method.Name;
}
......@@ -173,8 +172,7 @@ protected override bool CanAddImportForType(string diagnosticId, SyntaxNode node
case CS1574:
case CS1584:
var cref = node as QualifiedCrefSyntax;
if (cref != null)
if (node is QualifiedCrefSyntax cref)
{
node = cref.Container;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册