提交 87215f13 编写于 作者: C CyrusNajmabadi

Use inline variables.

上级 dc30d283
......@@ -202,8 +202,7 @@ private static Entry GetCachedEntry(SemanticModel model)
{
using (s_gate.DisposableRead())
{
Entry entry;
if (s_cache.TryGetValue(model, out entry))
if (s_cache.TryGetValue(model, out var entry))
{
return entry;
}
......@@ -234,8 +233,7 @@ public static void Stop(SemanticModel model)
using (s_gate.DisposableWrite())
{
Entry entry;
if (!s_cache.TryGetValue(model, out entry))
if (!s_cache.TryGetValue(model, out var entry))
{
return;
}
......
......@@ -65,8 +65,7 @@ internal partial class FindReferencesSearchEngine
Dictionary<Project, Dictionary<Document, List<(SymbolAndProjectId symbolAndProjectId, IReferenceFinder finder)>>> projectMap,
ProgressWrapper wrapper)
{
Dictionary<Document, List<(SymbolAndProjectId symbolAndProjectId, IReferenceFinder finder)>> map;
if (!projectMap.TryGetValue(project, out map))
if (!projectMap.TryGetValue(project, out var map))
{
// No files in this project to process. We can bail here. We'll have cached our
// compilation if there are any projects left to process that depend on us.
......
......@@ -44,8 +44,7 @@ protected override bool CanFind(IMethodSymbol symbol)
PredefinedOperator op,
SyntaxToken token)
{
PredefinedOperator actualOperator;
return syntaxFacts.TryGetPredefinedOperator(token, out actualOperator) && actualOperator == op;
return syntaxFacts.TryGetPredefinedOperator(token, out var actualOperator) && actualOperator == op;
}
}
}
......@@ -51,8 +51,7 @@ internal static class ReferenceLocationExtensions
var containingSymbol = GetEnclosingMethodOrPropertyOrField(semanticModel, reference);
if (containingSymbol != null)
{
List<Location> locations;
if (!result.TryGetValue(containingSymbol, out locations))
if (!result.TryGetValue(containingSymbol, out var locations))
{
locations = new List<Location>();
result.Add(containingSymbol, locations);
......
......@@ -356,8 +356,7 @@ public static async Task<IEnumerable<SymbolCallerInfo>> FindCallersAsync(ISymbol
return false;
}
Compilation symbolToMatchCompilation = null;
if (!TryGetCompilation(symbolToMatch, solution, out symbolToMatchCompilation, cancellationToken))
if (!TryGetCompilation(symbolToMatch, solution, out var symbolToMatchCompilation, cancellationToken))
{
return false;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册