Fix Cppcheck self check warning; use reference to avoid data copying

This commit is contained in:
Daniel Marjamäki 2021-01-04 01:47:04 +01:00
parent 38aa0fa2f0
commit da198e0726
1 changed files with 1 additions and 1 deletions

View File

@ -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;