Skip to content

Commit e1c8fa6

Browse files
committed
valueflow.cpp: void unnecessary object creation in valueFlowFunctionDefaultParameter() [skip ci]
1 parent f9e5be1 commit e1c8fa6

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/valueflow.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5650,11 +5650,12 @@ static void valueFlowFunctionDefaultParameter(const TokenList& tokenlist, const
56505650
const std::list<ValueFlow::Value> &values = var->nameToken()->tokAt(2)->values();
56515651
std::list<ValueFlow::Value> argvalues;
56525652
for (const ValueFlow::Value &value : values) {
5653+
if (!value.isPossible())
5654+
continue;
56535655
ValueFlow::Value v(value);
56545656
v.defaultArg = true;
56555657
v.changeKnownToPossible();
5656-
if (v.isPossible())
5657-
argvalues.push_back(std::move(v));
5658+
argvalues.push_back(std::move(v));
56585659
}
56595660
if (!argvalues.empty())
56605661
valueFlowInjectParameter(tokenlist, errorLogger, settings, var, scope, argvalues);

0 commit comments

Comments
 (0)