Skip to content

Commit 7a68434

Browse files
committed
valueflow.cpp: void unnecessary object creation in valueFlowFunctionDefaultParameter() [skip ci]
1 parent 523941c commit 7a68434

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
@@ -5639,11 +5639,12 @@ static void valueFlowFunctionDefaultParameter(const TokenList& tokenlist, const
56395639
const std::list<ValueFlow::Value> &values = var->nameToken()->tokAt(2)->values();
56405640
std::list<ValueFlow::Value> argvalues;
56415641
for (const ValueFlow::Value &value : values) {
5642+
if (!value.isPossible())
5643+
continue;
56425644
ValueFlow::Value v(value);
56435645
v.defaultArg = true;
56445646
v.changeKnownToPossible();
5645-
if (v.isPossible())
5646-
argvalues.push_back(std::move(v));
5647+
argvalues.push_back(std::move(v));
56475648
}
56485649
if (!argvalues.empty())
56495650
valueFlowInjectParameter(tokenlist, errorLogger, settings, var, scope, std::move(argvalues));

0 commit comments

Comments
 (0)