Skip to content

Commit 1250d70

Browse files
committed
made Scope::findInNestedListRecursive() const
1 parent 1f72150 commit 1250d70

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/symboldatabase.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6510,7 +6510,7 @@ Type* Scope::findType(const std::string& name)
65106510

65116511
//---------------------------------------------------------------------------
65126512

6513-
Scope *Scope::findInNestedListRecursive(const std::string & name)
6513+
const Scope *Scope::findInNestedListRecursive(const std::string & name) const
65146514
{
65156515
auto it = std::find_if(nestedList.cbegin(), nestedList.cend(), [&](const Scope* s) {
65166516
return s->className == name;
@@ -6519,7 +6519,7 @@ Scope *Scope::findInNestedListRecursive(const std::string & name)
65196519
return *it;
65206520

65216521
for (Scope* scope: nestedList) {
6522-
Scope *child = scope->findInNestedListRecursive(name);
6522+
const Scope *child = scope->findInNestedListRecursive(name);
65236523
if (child)
65246524
return child;
65256525
}

lib/symboldatabase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ class CPPCHECKLIB Scope {
11571157
* @brief find if name is in nested list
11581158
* @param name name of nested scope
11591159
*/
1160-
Scope *findInNestedListRecursive(const std::string & name);
1160+
const Scope *findInNestedListRecursive(const std::string & name) const;
11611161

11621162
void addVariable(const Token *token_, const Token *start_,
11631163
const Token *end_, AccessControl access_, const Type *type_,

0 commit comments

Comments
 (0)