Skip to content

Commit f462b6a

Browse files
committed
valueflow.cpp: avoid unnecessary copy in valueFlowLifetime()
1 parent e5d12bc commit f462b6a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/valueflow.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3426,10 +3426,10 @@ static void valueFlowLifetime(TokenList &tokenlist, ErrorLogger &errorLogger, co
34263426
else if (tok->isUnaryOp("&")) {
34273427
if (Token::simpleMatch(tok->astParent(), "*"))
34283428
continue;
3429-
for (const ValueFlow::LifetimeToken& lt : ValueFlow::getLifetimeTokens(tok->astOperand1(), settings)) {
3429+
for (ValueFlow::LifetimeToken& lt : ValueFlow::getLifetimeTokens(tok->astOperand1(), settings)) {
34303430
if (!settings.certainty.isEnabled(Certainty::inconclusive) && lt.inconclusive)
34313431
continue;
3432-
ErrorPath errorPath = lt.errorPath;
3432+
ErrorPath& errorPath = lt.errorPath;
34333433
errorPath.emplace_back(tok, "Address of variable taken here.");
34343434

34353435
ValueFlow::Value value;

0 commit comments

Comments
 (0)