From 35c6141e9ca602d107b8d29cbda8afca55aa0063 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Thu, 14 Jan 2021 21:03:41 +0100 Subject: Refactoring: modernize g_usingDeclarations --- src/doxygen.cpp | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 69897e9..6a35a0d 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -166,7 +166,7 @@ static std::multimap< std::string, const Entry* > g_classEntries; static StringVector g_inputFiles; static StringSet g_compoundKeywords; // keywords recognised as compounds static OutputList *g_outputList = 0; // list of output generating objects -static QDict g_usingDeclarations(1009); // used classes +static StringSet g_usingDeclarations; // used classes static bool g_successfulRun = FALSE; static bool g_dumpSymbolMap = FALSE; static bool g_useOutputTemplate = FALSE; @@ -832,17 +832,14 @@ static Definition *findScopeFromQualifiedName(NamespaceDefMutable *startScope,co // the scope relations! // Therefore loop through all used classes and see if there is a right // scope match between the used class and nestedNameSpecifier. - QDictIterator ui(g_usingDeclarations); - FileDef *usedFd; - for (ui.toFirst();(usedFd=ui.current());++ui) + for (const auto &usedName : g_usingDeclarations) { //printf("Checking using class %s\n",ui.currentKey()); - if (rightScopeMatch(ui.currentKey(),nestedNameSpecifier)) + if (rightScopeMatch(usedName.c_str(),nestedNameSpecifier)) { // ui.currentKey() is the fully qualified name of nestedNameSpecifier // so use this instead. - QCString fqn = QCString(ui.currentKey())+ - scope.right(scope.length()-p); + QCString fqn = QCString(usedName) + scope.right(scope.length()-p); resultScope = buildScopeFromQualifiedName(fqn,startScope->getLanguage(),0); //printf("Creating scope from fqn=%s result %p\n",fqn.data(),resultScope); if (resultScope) @@ -1821,15 +1818,7 @@ static void buildListOfUsingDecls(const Entry *root) ) { QCString name = substitute(root->name,".","::"); - - if (g_usingDeclarations.find(name)==0) - { - FileDef *fd = root->fileDef(); - if (fd) - { - g_usingDeclarations.insert(name,fd); - } - } + g_usingDeclarations.insert(name.str()); } for (const auto &e : root->children()) buildListOfUsingDecls(e.get()); } -- cgit v0.12