Skip to content

Commit ae7b70f

Browse files
committed
valueflow.cpp: do not create object until necessary in LifetimeStore::byVal()
1 parent 0e8c953 commit ae7b70f

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
@@ -2391,12 +2391,12 @@ struct LifetimeStore {
23912391
for (const ValueFlow::LifetimeToken& lt : ValueFlow::getLifetimeTokens(tok3, settings)) {
23922392
if (!settings.certainty.isEnabled(Certainty::inconclusive) && lt.inconclusive)
23932393
continue;
2394-
ErrorPath er = v.errorPath;
2395-
er.insert(er.end(), lt.errorPath.cbegin(), lt.errorPath.cend());
23962394
if (!lt.token)
23972395
return false;
23982396
if (!pred(lt.token))
23992397
return false;
2398+
ErrorPath er = v.errorPath;
2399+
er.insert(er.end(), lt.errorPath.cbegin(), lt.errorPath.cend());
24002400
er.emplace_back(argtok, message);
24012401
er.insert(er.end(), errorPath.cbegin(), errorPath.cend());
24022402

0 commit comments

Comments
 (0)