From 31dd2f4dce419b6623db7473d070b31ef8b69fef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Fri, 22 Mar 2024 15:11:55 +0100 Subject: [PATCH] valueflow.cpp: removed unnecessary parameter from deprecated `valueFlowReverse()` (#6171) as we only pass a default constructed object, `varId` will always be 0 and thus never be used --- lib/valueflow.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index aa194ea1727..5cd88caf415 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -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 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) @@ -7639,7 +7635,6 @@ static void valueFlowSwitchVariable(const TokenList &tokenlist, const SymbolData const_cast(scope.classDef), vartok, *val, - ValueFlow::Value(), errorLogger, settings); }