Skip to content

Commit

Permalink
valueflow.cpp: removed unnecessary parameter from deprecated `valueFl…
Browse files Browse the repository at this point in the history
…owReverse()` (#6171)

as we only pass a default constructed object, `varId` will always be 0
and thus never be used
  • Loading branch information
firewave committed Mar 22, 2024
1 parent 5dcf217 commit 31dd2f4
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/valueflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2200,15 +2200,11 @@ static void valueFlowReverse(const TokenList& tokenlist,
Token* tok,
const Token* const varToken,
ValueFlow::Value val,
const ValueFlow::Value& val2,
ErrorLogger* errorLogger,
const Settings& settings,
SourceLocation loc = SourceLocation::current())
{
std::list<ValueFlow::Value> values = {std::move(val)};
if (val2.varId != 0)
values.push_back(val2);
valueFlowReverse(tok, nullptr, varToken, std::move(values), tokenlist, errorLogger, settings, loc);
valueFlowReverse(tok, nullptr, varToken, {std::move(val)}, tokenlist, errorLogger, settings, loc);
}

static bool isConditionKnown(const Token* tok, bool then)
Expand Down Expand Up @@ -7639,7 +7635,6 @@ static void valueFlowSwitchVariable(const TokenList &tokenlist, const SymbolData
const_cast<Token*>(scope.classDef),
vartok,
*val,
ValueFlow::Value(),
errorLogger,
settings);
}
Expand Down

0 comments on commit 31dd2f4

Please sign in to comment.