Fix Cppcheck self check warning; use reference to avoid data copying
This commit is contained in:
parent
38aa0fa2f0
commit
da198e0726
|
@ -247,7 +247,7 @@ void CheckType::checkIntegerOverflowOptimisations()
|
||||||
if (!Token::Match(tok, "<|<=|>=|>") || !tok->isBinaryOp())
|
if (!Token::Match(tok, "<|<=|>=|>") || !tok->isBinaryOp())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const std::string cmp = tok->str();
|
const std::string &cmp = tok->str();
|
||||||
const Token * const lhs = tok->astOperand1();
|
const Token * const lhs = tok->astOperand1();
|
||||||
if (!Token::Match(lhs, "[+-]") || !lhs->isBinaryOp() || !lhs->valueType() || !lhs->valueType()->isIntegral() || lhs->valueType()->sign != ValueType::Sign::SIGNED)
|
if (!Token::Match(lhs, "[+-]") || !lhs->isBinaryOp() || !lhs->valueType() || !lhs->valueType()->isIntegral() || lhs->valueType()->sign != ValueType::Sign::SIGNED)
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue