Refactoring, use early continue

This commit is contained in:
Daniel Marjamäki 2018-04-23 16:23:22 +02:00
parent 84aaec26e6
commit 6d86ad78ba
1 changed files with 42 additions and 40 deletions

View File

@ -9902,9 +9902,12 @@ void Tokenizer::printUnknownTypes() const
for (unsigned int i = 1; i <= _varId; ++i) { for (unsigned int i = 1; i <= _varId; ++i) {
const Variable *var = _symbolDatabase->getVariableFromVarId(i); const Variable *var = _symbolDatabase->getVariableFromVarId(i);
if (!var)
continue;
// is unknown type? // is unknown type?
if (var && !var->type() && !var->typeStartToken()->isStandardType()) { if (var->type() || var->typeStartToken()->isStandardType())
continue;
std::string name; std::string name;
const Token * nameTok; const Token * nameTok;
@ -9946,7 +9949,6 @@ void Tokenizer::printUnknownTypes() const
unknowns.insert(std::pair<std::string, const Token *>(name, nameTok)); unknowns.insert(std::pair<std::string, const Token *>(name, nameTok));
} }
}
if (!unknowns.empty()) { if (!unknowns.empty()) {
std::string last; std::string last;