Fix Cppcheck performance warning stlFindInsert properly

This commit is contained in:
Daniel Marjamäki 2020-12-19 22:23:25 +01:00
parent 079255d913
commit 28e33ef0b9
1 changed files with 3 additions and 3 deletions

View File

@ -197,9 +197,9 @@ void Settings::loadSummaries()
// noreturn..
if (line.find(" noreturn:[") != std::string::npos || line.find(" call:[") != std::string::npos)
summaryNoreturn[functionName] = true;
else if (summaryNoreturn.find(functionName) == summaryNoreturn.end())
// cppcheck-suppress stlFindInsert
summaryNoreturn[functionName] = false;
else
// If there is a value for function already keep it, otherwise insert false
summaryNoreturn.emplace(std::pair<std::string,bool>(functionName, false));
}
}
}