提交 1746d0b9 编写于 作者: R Ravi Chande

Use TryGetValue

上级 7ffca327
......@@ -297,9 +297,10 @@ private Task<AbstractSyntaxContext> GetOrCreateContext(Document document, int po
{
lock (s_cacheGate)
{
if (s_cachedDocuments[document] != null)
Task<AbstractSyntaxContext> cachedContext;
if (s_cachedDocuments.TryGetValue(document, out cachedContext) && cachedContext != null)
{
return s_cachedDocuments[document];
return cachedContext;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册