From 7e8f405c6de3b758eccb3b44546b49020ca6ce55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Mon, 9 Nov 2020 21:14:46 +0100 Subject: [PATCH] Refactoring --- lib/symboldatabase.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index b011c5a66..5bb34ab44 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -1838,13 +1838,13 @@ Variable::Variable(const Token *name_, const std::string &clangType, const Token mTypeStartToken = mTypeEndToken; while (Token::Match(mTypeStartToken->previous(), "%type%|*|&")) mTypeStartToken = mTypeStartToken->previous(); - if (mTypeStartToken->str() == "const") - mTypeStartToken = mTypeStartToken->next(); - if (mTypeStartToken->str() == "struct") - mTypeStartToken = mTypeStartToken->next(); } - if (Token::simpleMatch(mTypeStartToken, "static")) - setFlag(fIsStatic, true); + + while (Token::Match(mTypeStartToken, "const|struct|static")) { + if (mTypeStartToken->str() == "static") + setFlag(fIsStatic, true); + mTypeStartToken = mTypeStartToken->next(); + } if (endsWith(clangType, " &", 2)) setFlag(fIsReference, true);