Skip to content

Commit da198e0

Browse files
committed
Fix Cppcheck self check warning; use reference to avoid data copying
1 parent 38aa0fa commit da198e0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/checktype.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ void CheckType::checkIntegerOverflowOptimisations()
247247
if (!Token::Match(tok, "<|<=|>=|>") || !tok->isBinaryOp())
248248
continue;
249249

250-
const std::string cmp = tok->str();
250+
const std::string &cmp = tok->str();
251251
const Token * const lhs = tok->astOperand1();
252252
if (!Token::Match(lhs, "[+-]") || !lhs->isBinaryOp() || !lhs->valueType() || !lhs->valueType()->isIntegral() || lhs->valueType()->sign != ValueType::Sign::SIGNED)
253253
continue;

0 commit comments

Comments
 (0)