提交 bd2366e4 编写于 作者: C Cyrus Najmabadi

Simplify.

上级 38c691bb
......@@ -113,14 +113,10 @@ protected override void InitializeWorker(AnalysisContext context)
}
// Arg needs to be a subtraction for: `s.Length - value`
// And left side of the subtraction needs to be `s.Length`
var arg = propertyReference.Arguments[0];
if (!IsSubtraction(arg, out var subtraction))
{
return;
}
// Left side of the subtraction needs to be `s.Length`
if (!IsInstanceLengthCheck(lengthLikeProperty, propertyReference.Instance, subtraction.LeftOperand))
if (!IsSubtraction(arg, out var subtraction) ||
!IsInstanceLengthCheck(lengthLikeProperty, propertyReference.Instance, subtraction.LeftOperand))
{
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册