@@ -1008,7 +1008,7 @@ bool Library::isnullargbad(const Token *ftok, int argnr) const
10081008 if (!arg) {
10091009 // scan format string argument should not be null
10101010 const std::string funcname = getFunctionName (ftok);
1011- const std::map <std::string, Function>::const_iterator it = functions.find (funcname);
1011+ const std::unordered_map <std::string, Function>::const_iterator it = functions.find (funcname);
10121012 if (it != functions.cend () && it->second .formatstr && it->second .formatstr_scan )
10131013 return true ;
10141014 }
@@ -1021,7 +1021,7 @@ bool Library::isuninitargbad(const Token *ftok, int argnr, int indirect, bool *h
10211021 if (!arg) {
10221022 // non-scan format string argument should not be uninitialized
10231023 const std::string funcname = getFunctionName (ftok);
1024- const std::map <std::string, Function>::const_iterator it = functions.find (funcname);
1024+ const std::unordered_map <std::string, Function>::const_iterator it = functions.find (funcname);
10251025 if (it != functions.cend () && it->second .formatstr && !it->second .formatstr_scan )
10261026 return true ;
10271027 }
@@ -1078,7 +1078,7 @@ const Library::ArgumentChecks * Library::getarg(const Token *ftok, int argnr) co
10781078{
10791079 if (isNotLibraryFunction (ftok))
10801080 return nullptr ;
1081- const std::map <std::string, Function>::const_iterator it1 = functions.find (getFunctionName (ftok));
1081+ const std::unordered_map <std::string, Function>::const_iterator it1 = functions.find (getFunctionName (ftok));
10821082 if (it1 == functions.cend ())
10831083 return nullptr ;
10841084 const std::map<int ,ArgumentChecks>::const_iterator it2 = it1->second .argumentChecks .find (argnr);
@@ -1189,7 +1189,7 @@ bool Library::isNotLibraryFunction(const Token *ftok) const
11891189bool Library::matchArguments (const Token *ftok, const std::string &functionName) const
11901190{
11911191 const int callargs = numberOfArguments (ftok);
1192- const std::map <std::string, Function>::const_iterator it = functions.find (functionName);
1192+ const std::unordered_map <std::string, Function>::const_iterator it = functions.find (functionName);
11931193 if (it == functions.cend ())
11941194 return (callargs == 0 );
11951195 int args = 0 ;
@@ -1259,7 +1259,7 @@ bool Library::formatstr_function(const Token* ftok) const
12591259 if (isNotLibraryFunction (ftok))
12601260 return false ;
12611261
1262- const std::map <std::string, Function>::const_iterator it = functions.find (getFunctionName (ftok));
1262+ const std::unordered_map <std::string, Function>::const_iterator it = functions.find (getFunctionName (ftok));
12631263 if (it != functions.cend ())
12641264 return it->second .formatstr ;
12651265 return false ;
@@ -1290,7 +1290,7 @@ Library::UseRetValType Library::getUseRetValType(const Token *ftok) const
12901290{
12911291 if (isNotLibraryFunction (ftok))
12921292 return Library::UseRetValType::NONE ;
1293- const std::map <std::string, Function>::const_iterator it = functions.find (getFunctionName (ftok));
1293+ const std::unordered_map <std::string, Function>::const_iterator it = functions.find (getFunctionName (ftok));
12941294 if (it != functions.cend ())
12951295 return it->second .useretval ;
12961296 return Library::UseRetValType::NONE ;
@@ -1332,7 +1332,7 @@ const Library::Function *Library::getFunction(const Token *ftok) const
13321332{
13331333 if (isNotLibraryFunction (ftok))
13341334 return nullptr ;
1335- const std::map <std::string, Function>::const_iterator it1 = functions.find (getFunctionName (ftok));
1335+ const std::unordered_map <std::string, Function>::const_iterator it1 = functions.find (getFunctionName (ftok));
13361336 if (it1 == functions.cend ())
13371337 return nullptr ;
13381338 return &it1->second ;
@@ -1343,7 +1343,7 @@ bool Library::hasminsize(const Token *ftok) const
13431343{
13441344 if (isNotLibraryFunction (ftok))
13451345 return false ;
1346- const std::map <std::string, Function>::const_iterator it1 = functions.find (getFunctionName (ftok));
1346+ const std::unordered_map <std::string, Function>::const_iterator it1 = functions.find (getFunctionName (ftok));
13471347 if (it1 == functions.cend ())
13481348 return false ;
13491349 for (std::map<int , ArgumentChecks>::const_iterator it2 = it1->second .argumentChecks .cbegin (); it2 != it1->second .argumentChecks .cend (); ++it2) {
@@ -1372,28 +1372,28 @@ Library::ArgumentChecks::Direction Library::getArgDirection(const Token* ftok, i
13721372
13731373bool Library::ignorefunction (const std::string& functionName) const
13741374{
1375- const std::map <std::string, Function>::const_iterator it = functions.find (functionName);
1375+ const std::unordered_map <std::string, Function>::const_iterator it = functions.find (functionName);
13761376 if (it != functions.cend ())
13771377 return it->second .ignore ;
13781378 return false ;
13791379}
13801380bool Library::isUse (const std::string& functionName) const
13811381{
1382- const std::map <std::string, Function>::const_iterator it = functions.find (functionName);
1382+ const std::unordered_map <std::string, Function>::const_iterator it = functions.find (functionName);
13831383 if (it != functions.cend ())
13841384 return it->second .use ;
13851385 return false ;
13861386}
13871387bool Library::isLeakIgnore (const std::string& functionName) const
13881388{
1389- const std::map <std::string, Function>::const_iterator it = functions.find (functionName);
1389+ const std::unordered_map <std::string, Function>::const_iterator it = functions.find (functionName);
13901390 if (it != functions.cend ())
13911391 return it->second .leakignore ;
13921392 return false ;
13931393}
13941394bool Library::isFunctionConst (const std::string& functionName, bool pure) const
13951395{
1396- const std::map <std::string, Function>::const_iterator it = functions.find (functionName);
1396+ const std::unordered_map <std::string, Function>::const_iterator it = functions.find (functionName);
13971397 if (it != functions.cend ())
13981398 return pure ? it->second .ispure : it->second .isconst ;
13991399 return false ;
@@ -1404,7 +1404,7 @@ bool Library::isFunctionConst(const Token *ftok) const
14041404 return true ;
14051405 if (isNotLibraryFunction (ftok))
14061406 return false ;
1407- const std::map <std::string, Function>::const_iterator it = functions.find (getFunctionName (ftok));
1407+ const std::unordered_map <std::string, Function>::const_iterator it = functions.find (getFunctionName (ftok));
14081408 return (it != functions.end () && it->second .isconst );
14091409}
14101410
0 commit comments