SymbolDatabase: Simplification of code. My assumption is that start and end of scope is never null.
This commit is contained in:
parent
ba8222de1c
commit
aa38556e1c
|
@ -1127,18 +1127,17 @@ void SymbolDatabase::createSymbolDatabaseSetScopePointers()
|
||||||
start = const_cast<Token*>(_tokenizer->list.front());
|
start = const_cast<Token*>(_tokenizer->list.front());
|
||||||
end = const_cast<Token*>(_tokenizer->list.back());
|
end = const_cast<Token*>(_tokenizer->list.back());
|
||||||
}
|
}
|
||||||
if (start && end) {
|
assert(start && end);
|
||||||
start->scope(&*it);
|
|
||||||
end->scope(&*it);
|
end->scope(&*it);
|
||||||
}
|
|
||||||
if (start != end && start->next() != end) {
|
for (Token* tok = start; tok != end; tok = tok->next()) {
|
||||||
for (Token* tok = start->next(); tok != end; tok = tok->next()) {
|
if (start != end && tok->str() == "{") {
|
||||||
if (tok->str() == "{") {
|
|
||||||
bool isEndOfScope = false;
|
bool isEndOfScope = false;
|
||||||
for (std::list<Scope*>::const_iterator innerScope = it->nestedList.begin(); innerScope != it->nestedList.end(); ++innerScope) {
|
for (std::list<Scope*>::const_iterator innerScope = it->nestedList.begin(); innerScope != it->nestedList.end(); ++innerScope) {
|
||||||
if (tok == (*innerScope)->classStart) { // Is begin of inner scope
|
if (tok == (*innerScope)->classStart) { // Is begin of inner scope
|
||||||
tok = tok->link();
|
tok = tok->link();
|
||||||
if (!tok || tok->next() == end || !tok->next()) {
|
if (tok->next() == end || !tok->next()) {
|
||||||
isEndOfScope = true;
|
isEndOfScope = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1153,7 +1152,6 @@ void SymbolDatabase::createSymbolDatabaseSetScopePointers()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void SymbolDatabase::createSymbolDatabaseSetFunctionPointers(bool firstPass)
|
void SymbolDatabase::createSymbolDatabaseSetFunctionPointers(bool firstPass)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue