From f021094f753921d9cac039c12cee7e30a0ba56f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Mon, 23 Apr 2018 21:45:25 +0200 Subject: [PATCH] minor refactorings in SymbolDatabase --- lib/symboldatabase.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 876565c95..ddfd3cf64 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -3074,10 +3074,9 @@ static const Type* findVariableTypeIncludingUsedNamespaces(const SymbolDatabase* // look for variable type in any using namespace in this scope or above while (scope) { - for (std::list::const_iterator ui = scope->usingList.begin(); - ui != scope->usingList.end(); ++ui) { - if (ui->scope) { - argType = symbolDatabase->findVariableType(ui->scope, typeTok); + for (const Scope::UsingInfo &ui : scope->usingList) { + if (ui.scope) { + argType = symbolDatabase->findVariableType(ui.scope, typeTok); if (argType) return argType; } @@ -3492,7 +3491,7 @@ const Token *Scope::checkVariable(const Token *tok, AccessControl varaccess, con } if ((Token::Match(tok, "throw %any% :: %any% (") && - Token::simpleMatch(tok->linkAt(4), ") ;"))) { + Token::simpleMatch(tok->linkAt(4), ") ;"))) { return tok->linkAt(4); }