CheckOther::checkDuplicateExpression(): be lazier if style-reports are not enabled. NFCI.
This commit is contained in:
parent
899615c1e4
commit
a2c716fa3b
|
@ -1939,7 +1939,7 @@ void CheckOther::checkDuplicateExpression()
|
||||||
const bool assignment = tok->str() == "=";
|
const bool assignment = tok->str() == "=";
|
||||||
if (assignment && warningEnabled)
|
if (assignment && warningEnabled)
|
||||||
selfAssignmentError(tok, tok->astOperand1()->expressionString());
|
selfAssignmentError(tok, tok->astOperand1()->expressionString());
|
||||||
else {
|
else if (styleEnabled) {
|
||||||
if (_tokenizer->isCPP() && _settings->standards.cpp==Standards::CPP11 && tok->str() == "==") {
|
if (_tokenizer->isCPP() && _settings->standards.cpp==Standards::CPP11 && tok->str() == "==") {
|
||||||
const Token* parent = tok->astParent();
|
const Token* parent = tok->astParent();
|
||||||
while (parent && parent->astParent()) {
|
while (parent && parent->astParent()) {
|
||||||
|
@ -1949,7 +1949,6 @@ void CheckOther::checkDuplicateExpression()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (styleEnabled)
|
|
||||||
duplicateExpressionError(tok, tok, tok->str());
|
duplicateExpressionError(tok, tok, tok->str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue