Skip to content

Commit 9d9e091

Browse files
committed
valueflow.cpp: avoid unnecessary copy in valueFlowLifetime()
1 parent a0e1e5e commit 9d9e091

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
@@ -3007,10 +3007,10 @@ static void valueFlowLifetime(TokenList &tokenlist, ErrorLogger &errorLogger, co
30073007
if (tok2 && tok2 != op1 && (!tok2->variable() || !tok2->variable()->isArray()) && !(tok2->valueType() && tok2->valueType()->container))
30083008
continue;
30093009
}
3010-
for (const ValueFlow::LifetimeToken& lt : ValueFlow::getLifetimeTokens(tok->astOperand1(), settings)) {
3010+
for (ValueFlow::LifetimeToken& lt : ValueFlow::getLifetimeTokens(tok->astOperand1(), settings)) {
30113011
if (!settings.certainty.isEnabled(Certainty::inconclusive) && lt.inconclusive)
30123012
continue;
3013-
ErrorPath errorPath = lt.errorPath;
3013+
ErrorPath& errorPath = lt.errorPath;
30143014
errorPath.emplace_back(tok, "Address of variable taken here.");
30153015

30163016
ValueFlow::Value value;

0 commit comments

Comments
 (0)