GUI: use range for instead of foreach

This commit is contained in:
Daniel Marjamäki 2022-02-05 11:33:28 +01:00
parent 508fa6284c
commit 0c66453c21
2 changed files with 7 additions and 7 deletions

View File

@ -99,10 +99,10 @@ unsigned CheckStatistics::getCount(const QString &tool, ShowTypes::ShowType type
QStringList CheckStatistics::getTools() const
{
QSet<QString> ret;
foreach (QString tool, mStyle.keys()) ret.insert(tool);
foreach (QString tool, mWarning.keys()) ret.insert(tool);
foreach (QString tool, mPerformance.keys()) ret.insert(tool);
foreach (QString tool, mPortability.keys()) ret.insert(tool);
foreach (QString tool, mError.keys()) ret.insert(tool);
for (const QString& tool: mStyle.keys()) ret.insert(tool);
for (const QString& tool: mWarning.keys()) ret.insert(tool);
for (const QString& tool: mPerformance.keys()) ret.insert(tool);
for (const QString& tool: mPortability.keys()) ret.insert(tool);
for (const QString& tool: mError.keys()) ret.insert(tool);
return QStringList(ret.values());
}

View File

@ -515,7 +515,7 @@ void MainWindow::doAnalyzeFiles(const QStringList &files, const bool checkLibrar
if (!checkSettings.buildDir.empty()) {
checkSettings.loadSummaries();
std::list<std::string> sourcefiles;
foreach (QString s, fileNames)
for (const QString& s: fileNames)
sourcefiles.push_back(s.toStdString());
AnalyzerInformation::writeFilesTxt(checkSettings.buildDir, sourcefiles, checkSettings.userDefines, checkSettings.project.fileSettings);
}