Skip to content

Commit dac578e

Browse files
authored
ValueFlow: avoid unnecessary Value copies (#4835)
1 parent 4912990 commit dac578e

2 files changed

Lines changed: 112 additions & 111 deletions

File tree

lib/token.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2154,7 +2154,8 @@ bool Token::addValue(const ValueFlow::Value &value)
21542154
ValueFlow::Value v(value);
21552155
if (v.varId == 0)
21562156
v.varId = mImpl->mVarId;
2157-
mImpl->mValues = new std::list<ValueFlow::Value>(1, v);
2157+
mImpl->mValues = new std::list<ValueFlow::Value>;
2158+
mImpl->mValues->push_back(std::move(v));
21582159
}
21592160

21602161
removeContradictions(*mImpl->mValues);

0 commit comments

Comments
 (0)