A =如果infos!为空并且输入为空 - 请删除;
B =如果infos为空并且输入!为空 - 请添加;
C = if infos!empty和inputs!等于infos - do add;
我们可以喜欢:
if B //it's the most common operation, so at the beginning.
{
//add
}
else
{
//remove
}
elseif(c)
{
//the same add
}
Run Code Online (Sandbox Code Playgroud)
我相信这可以更好地思考.我可以帮忙吗?
提前致谢,