Skip to content

Commit

Permalink
Variable shadowing
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Sep 16, 2023
1 parent c9e1915 commit 6ba3165
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/symboldatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5045,15 +5045,12 @@ const Enumerator * SymbolDatabase::findEnumerator(const Token * tok, std::set<st
// FIXME search base class here

const Scope* temp{};
if (scope->functionOf) {
temp = scope->functionOf->findRecordInNestedList(tok1->str());
}
if (temp) {
if (scope->functionOf && (temp = scope->functionOf->findRecordInNestedList(tok1->str()))) {
scope = temp;
} else {
// find first scope
while (scope && scope->nestedIn) {
const Scope * temp = scope->nestedIn->findRecordInNestedList(tok1->str());
temp = scope->nestedIn->findRecordInNestedList(tok1->str());
if (temp) {
scope = temp;
break;
Expand Down

0 comments on commit 6ba3165

Please sign in to comment.