提交 3cbbe400 编写于 作者: C CyrusNajmabadi

Use patterns in more places.

上级 5071d591
...@@ -80,9 +80,9 @@ public static TSymbol GetEnclosingSymbol<TSymbol>(this SemanticModel semanticMod ...@@ -80,9 +80,9 @@ public static TSymbol GetEnclosingSymbol<TSymbol>(this SemanticModel semanticMod
symbol != null; symbol != null;
symbol = symbol.ContainingSymbol) symbol = symbol.ContainingSymbol)
{ {
if (symbol is TSymbol) if (symbol is TSymbol tSymbol)
{ {
return (TSymbol)symbol; return tSymbol;
} }
} }
......
...@@ -38,9 +38,9 @@ public static IEnumerable<TNode> GetAncestors<TNode>(this SyntaxNode node) ...@@ -38,9 +38,9 @@ public static IEnumerable<TNode> GetAncestors<TNode>(this SyntaxNode node)
var current = node.Parent; var current = node.Parent;
while (current != null) while (current != null)
{ {
if (current is TNode) if (current is TNode tNode)
{ {
yield return (TNode)current; yield return tNode;
} }
current = current is IStructuredTriviaSyntax current = current is IStructuredTriviaSyntax
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册