Tokenizer: Refactoring; use early return
This commit is contained in:
parent
df6a66deed
commit
b04285514f
|
@ -9681,21 +9681,21 @@ void Tokenizer::reportError(const std::list<const Token*>& callstack, Severity::
|
||||||
|
|
||||||
void Tokenizer::setPodTypes()
|
void Tokenizer::setPodTypes()
|
||||||
{
|
{
|
||||||
if (_settings) {
|
if (!_settings)
|
||||||
for (Token *tok = list.front(); tok; tok = tok->next()) {
|
return;
|
||||||
if (!tok->isName())
|
for (Token *tok = list.front(); tok; tok = tok->next()) {
|
||||||
continue;
|
if (!tok->isName())
|
||||||
|
continue;
|
||||||
|
|
||||||
// pod type
|
// pod type
|
||||||
const struct Library::PodType *podType = _settings->library.podtype(tok->str());
|
const struct Library::PodType *podType = _settings->library.podtype(tok->str());
|
||||||
if (podType) {
|
if (podType) {
|
||||||
const Token *prev = tok->previous();
|
const Token *prev = tok->previous();
|
||||||
while (prev && prev->isName())
|
while (prev && prev->isName())
|
||||||
prev = prev->previous();
|
prev = prev->previous();
|
||||||
if (prev && !Token::Match(prev, ";|{|}|,|("))
|
if (prev && !Token::Match(prev, ";|{|}|,|("))
|
||||||
continue;
|
continue;
|
||||||
tok->isStandardType(true);
|
tok->isStandardType(true);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue