@@ -721,8 +721,8 @@ void SymbolDatabase::createSymbolDatabaseFindAllScopes()
721721 }
722722
723723 bool newFunc = true; // Is this function already in the database?
724- auto range = scope->functionMap .equal_range (tok->str ());
725- for (std::multimap<std::string, const Function*>::const_iterator it = range.first ; it != range.second ; ++it) {
724+ auto range = utils::as_const( scope->functionMap) .equal_range(tok->str());
725+ for (auto it = range.first; it != range.second; ++it) {
726726 if (it->second->argsMatch(scope, it->second->argDef, argStart, "", 0)) {
727727 newFunc = false;
728728 break;
@@ -805,8 +805,8 @@ void SymbolDatabase::createSymbolDatabaseFindAllScopes()
805805 if (isFunction(ftok, scope, funcStart, argStart, declEnd)) {
806806 if (declEnd && declEnd->str() == ";") {
807807 bool newFunc = true; // Is this function already in the database?
808- auto range = scope->functionMap .equal_range (ftok->str ());
809- for (std::multimap<std::string, const Function*>::const_iterator it = range.first ; it != range.second ; ++it) {
808+ auto range = utils::as_const( scope->functionMap) .equal_range(ftok->str());
809+ for (auto it = range.first; it != range.second; ++it) {
810810 if (it->second->argsMatch(scope, it->second->argDef, argStart, "", 0)) {
811811 newFunc = false;
812812 break;
@@ -3449,8 +3449,8 @@ Function* SymbolDatabase::addGlobalFunction(Scope*& scope, const Token*& tok, co
34493449 Function* function = nullptr;
34503450 // Lambda functions are always unique
34513451 if (tok->str() != "[") {
3452- auto range = scope->functionMap .equal_range (tok->str ());
3453- for (std::multimap<std::string, const Function*>::const_iterator it = range.first ; it != range.second ; ++it) {
3452+ auto range = utils::as_const( scope->functionMap) .equal_range(tok->str());
3453+ for (auto it = range.first; it != range.second; ++it) {
34543454 const Function *f = it->second;
34553455 if (f->hasBody())
34563456 continue;
@@ -3609,8 +3609,8 @@ void SymbolDatabase::addClassFunction(Scope *&scope, const Token *&tok, const To
36093609 }
36103610
36113611 if (match) {
3612- auto range = scope1->functionMap .equal_range (tok->str ());
3613- for (std::multimap<std::string, const Function*>::const_iterator it = range.first ; it != range.second ; ++it) {
3612+ auto range = utils::as_const( scope1->functionMap) .equal_range(tok->str());
3613+ for (auto it = range.first; it != range.second; ++it) {
36143614 auto * func = const_cast<Function *>(it->second);
36153615 if (destructor && func->type != FunctionType::eDestructor)
36163616 continue;
0 commit comments