Skip to content

Commit b15c026

Browse files
committed
Fix, suppress
1 parent ca861f2 commit b15c026

5 files changed

Lines changed: 10 additions & 7 deletions

File tree

gui/checkstatistics.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ unsigned CheckStatistics::getCount(const QString &tool, ShowTypes::ShowType type
109109
QStringList CheckStatistics::getTools() const
110110
{
111111
QSet<QString> ret;
112-
for (const QString& tool: mStyle.keys()) ret.insert(tool);
113-
for (const QString& tool: mWarning.keys()) ret.insert(tool);
114-
for (const QString& tool: mPerformance.keys()) ret.insert(tool);
115-
for (const QString& tool: mPortability.keys()) ret.insert(tool);
116-
for (const QString& tool: mError.keys()) ret.insert(tool);
112+
std::copy(mStyle.keys().begin(), mStyle.keys().end(), std::inserter(ret, ret.end()));
113+
std::copy(mWarning.keys().begin(), mWarning.keys().end(), std::inserter(ret, ret.end()));
114+
std::copy(mPerformance.keys().begin(), mPerformance.keys().end(), std::inserter(ret, ret.end()));
115+
std::copy(mPortability.keys().begin(), mPortability.keys().end(), std::inserter(ret, ret.end()));
116+
std::copy(mError.keys().begin(), mError.keys().end(), std::inserter(ret, ret.end()));
117117
return ret.values();
118118
}

lib/checkother.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4584,6 +4584,7 @@ void CheckOtherImpl::checkUnionZeroInit()
45844584
std::unordered_map<const Scope *, Union> unionsByScopeId;
45854585
const std::vector<Union> unions = parseUnions(*symbolDatabase, mSettings);
45864586
for (const Union &u : unions) {
4587+
// cppcheck-suppress useStlAlgorithm - std::transform is cumbersome
45874588
unionsByScopeId.emplace(u.scope, u);
45884589
}
45894590

lib/symboldatabase.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,6 +1246,7 @@ void SymbolDatabase::createSymbolDatabaseSetTypePointers()
12461246
{
12471247
std::unordered_set<std::string> typenames;
12481248
for (const Type &t : typeList) {
1249+
// cppcheck-suppress useStlAlgorithm - std::transform is cumbersome
12491250
typenames.insert(t.name());
12501251
}
12511252

@@ -4599,8 +4600,7 @@ void SymbolDatabase::printXml(std::ostream &out) const
45994600
}
46004601

46014602
// Variables..
4602-
for (const Variable *var : mVariableList)
4603-
variables.insert(var);
4603+
std::copy(mVariableList.begin(), mVariableList.end(), std::inserter(variables, variables.end()));
46044604
outs += " <variables>\n";
46054605
for (const Variable *var : variables) {
46064606
if (!var)

lib/templatesimplifier.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3916,6 +3916,7 @@ void TemplateSimplifier::simplifyTemplates(const std::time_t maxtime)
39163916
std::unordered_map<std::string, int> nameOrdinal;
39173917
int ordinal = 0;
39183918
for (const auto& decl : mTemplateDeclarations) {
3919+
// cppcheck-suppress useStlAlgorithm - std::transform is cumbersome
39193920
nameOrdinal.emplace(decl.fullName(), ordinal++);
39203921
}
39213922

tools/dmake/dmake.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ static std::vector<std::string> prioritizelib(const std::vector<std::string>& li
297297
std::map<std::string, std::size_t> priorities;
298298
std::size_t prio = libfiles.size();
299299
for (const auto &l : libfiles) {
300+
// cppcheck-suppress useStlAlgorithm - std::transform is cumbersome
300301
priorities.emplace(l, prio--);
301302
}
302303
priorities["lib/valueflow.cpp"] = 1000;

0 commit comments

Comments
 (0)