Tokenizer: Refactoring; use early return

This commit is contained in:
Daniel Marjamäki 2016-05-12 15:51:30 +02:00
parent df6a66deed
commit b04285514f
1 changed files with 14 additions and 14 deletions

View File

@ -9681,21 +9681,21 @@ void Tokenizer::reportError(const std::list<const Token*>& callstack, Severity::
void Tokenizer::setPodTypes()
{
if (_settings) {
for (Token *tok = list.front(); tok; tok = tok->next()) {
if (!tok->isName())
continue;
if (!_settings)
return;
for (Token *tok = list.front(); tok; tok = tok->next()) {
if (!tok->isName())
continue;
// pod type
const struct Library::PodType *podType = _settings->library.podtype(tok->str());
if (podType) {
const Token *prev = tok->previous();
while (prev && prev->isName())
prev = prev->previous();
if (prev && !Token::Match(prev, ";|{|}|,|("))
continue;
tok->isStandardType(true);
}
// pod type
const struct Library::PodType *podType = _settings->library.podtype(tok->str());
if (podType) {
const Token *prev = tok->previous();
while (prev && prev->isName())
prev = prev->previous();
if (prev && !Token::Match(prev, ";|{|}|,|("))
continue;
tok->isStandardType(true);
}
}
}