Skip to content

Commit ed0e706

Browse files
committed
valueflow.cpp: do not create object until necessary in LifetimeStore::byVal()
1 parent 2471dc4 commit ed0e706

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
@@ -2166,12 +2166,12 @@ struct LifetimeStore {
21662166
for (const ValueFlow::LifetimeToken& lt : ValueFlow::getLifetimeTokens(tok3, settings)) {
21672167
if (!settings.certainty.isEnabled(Certainty::inconclusive) && lt.inconclusive)
21682168
continue;
2169-
ErrorPath er = v.errorPath;
2170-
er.insert(er.end(), lt.errorPath.cbegin(), lt.errorPath.cend());
21712169
if (!lt.token)
21722170
return false;
21732171
if (!pred(lt.token))
21742172
return false;
2173+
ErrorPath er = v.errorPath;
2174+
er.insert(er.end(), lt.errorPath.cbegin(), lt.errorPath.cend());
21752175
er.emplace_back(argtok, message);
21762176
er.insert(er.end(), errorPath.cbegin(), errorPath.cend());
21772177

0 commit comments

Comments
 (0)