提交 1ed12fa6 编写于 作者: Y yair halberstadt

Changes based on code review

上级 ea519fbe
......@@ -972,18 +972,18 @@ private static int CanonicallyCompareDiagnostics(Diagnostic x, Diagnostic y)
int codeCompare = xCode.CompareTo(yCode);
// Optimization: don't bother
if (codeCompare != 0)
return codeCompare;
// ToString fails for a diagnostic with an error code that does not prevent successful delegate conversion.
// Also, the order doesn't matter, since all such diagnostics will be dropped.
if (!ErrorFacts.PreventsSuccessfulDelegateConversion(xCode) || !ErrorFacts.PreventsSuccessfulDelegateConversion(yCode))
if (!ErrorFacts.PreventsSuccessfulDelegateConversion(xCode))
{
return codeCompare;
}
// Optimization: don't bother
if (codeCompare != 0)
return codeCompare;
for (int i = 0; i < x.Arguments.Count && i < y.Arguments.Count; i++)
for (int i = 0; i < Math.Min(x.Arguments.Count, y.Arguments.Count); i++)
{
object argx = x.Arguments[i];
object argy = y.Arguments[i];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册