Skip to content

Commit 21dfe6f

Browse files
committed
Scope: removed unnecessary Settings parameter from getVariableList() overload
1 parent f544ca3 commit 21dfe6f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/symboldatabase.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -4801,23 +4801,23 @@ void Scope::getVariableList()
48014801
{
48024802
if (!bodyStartList.empty()) {
48034803
for (const Token *bs: bodyStartList)
4804-
getVariableList(symdb->mTokenizer.getSettings(), bs->next(), bs->link());
4804+
getVariableList(bs->next(), bs->link());
48054805
}
48064806

48074807
// global scope
48084808
else if (type == Scope::eGlobal)
4809-
getVariableList(symdb->mTokenizer.getSettings(), symdb->mTokenizer.tokens(), nullptr);
4809+
getVariableList(symdb->mTokenizer.tokens(), nullptr);
48104810

48114811
// forward declaration
48124812
else
48134813
return;
48144814
}
48154815

4816-
void Scope::getVariableList(const Settings& settings, const Token* start, const Token* end)
4816+
void Scope::getVariableList(const Token* start, const Token* end)
48174817
{
48184818
// Variable declared in condition: if (auto x = bar())
48194819
if (Token::Match(classDef, "if|while ( %type%") && Token::simpleMatch(classDef->next()->astOperand2(), "=")) {
4820-
checkVariable(classDef->tokAt(2), defaultAccess(), settings);
4820+
checkVariable(classDef->tokAt(2), defaultAccess(), symdb->mTokenizer.getSettings());
48214821
}
48224822

48234823
AccessControl varaccess = defaultAccess();
@@ -4914,7 +4914,7 @@ void Scope::getVariableList(const Settings& settings, const Token* start, const
49144914
if (tok->str() == ";")
49154915
continue;
49164916

4917-
tok = checkVariable(tok, varaccess, settings);
4917+
tok = checkVariable(tok, varaccess, symdb->mTokenizer.getSettings());
49184918

49194919
if (!tok)
49204920
break;

lib/symboldatabase.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ class CPPCHECKLIB Scope {
12091209
void findFunctionInBase(const std::string & name, nonneg int args, std::vector<const Function *> & matches) const;
12101210

12111211
/** @brief initialize varlist */
1212-
void getVariableList(const Settings& settings, const Token *start, const Token *end);
1212+
void getVariableList(const Token *start, const Token *end);
12131213
};
12141214

12151215
/** Value type */

0 commit comments

Comments
 (0)