TokenList::validateAst: optimised ~25%

This commit is contained in:
Daniel Marjamäki 2018-05-09 12:36:58 +02:00
parent ecccce0608
commit ab6167e3e6
1 changed files with 5 additions and 2 deletions

View File

@ -1195,10 +1195,13 @@ void TokenList::validateAst() const
astTokens.insert(parent); astTokens.insert(parent);
} while ((parent = parent->astParent()) != nullptr); } while ((parent = parent->astParent()) != nullptr);
safeAstTokens.insert(astTokens.begin(), astTokens.end()); safeAstTokens.insert(astTokens.begin(), astTokens.end());
} else } else if (tok->str() == ";") {
safeAstTokens.clear();
} else {
safeAstTokens.insert(tok); safeAstTokens.insert(tok);
} }
} }
}
const std::string& TokenList::file(const Token *tok) const const std::string& TokenList::file(const Token *tok) const
{ {