未验证 提交 dd2c5d17 编写于 作者: Y Yair Halberstadt 提交者: GitHub

Code style changes based on further review

上级 5b0227c7
......@@ -976,17 +976,17 @@ private static int CanonicallyCompareDiagnostics(Diagnostic x, Diagnostic y)
if (codeCompare != 0)
return codeCompare;
for (int i = 0; i < Math.Min(x.Arguments.Count, y.Arguments.Count); i++)
for (int i = 0, n = Math.Min(x.Arguments.Count, y.Arguments.Count); i < n; i++)
{
object argx = x.Arguments[i];
object argy = y.Arguments[i];
codeCompare = string.CompareOrdinal(argx?.ToString(), argy?.ToString());
if (codeCompare != 0)
return codeCompare;
int argCompare = string.CompareOrdinal(argx?.ToString(), argy?.ToString());
if (argCompare != 0)
return argCompare;
}
return x.Arguments.Count.CompareTo(y.Arguments.Count);
return x.Arguments.Count - y.Arguments.Count;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册