From 5712366a8f0cc8864778bacf6fb78b5650b04e29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 13 Jul 2018 22:56:20 +0200 Subject: [PATCH] refactoring; use range for loops --- lib/analyzerinfo.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/analyzerinfo.cpp b/lib/analyzerinfo.cpp index dacf78484..b34140188 100644 --- a/lib/analyzerinfo.cpp +++ b/lib/analyzerinfo.cpp @@ -49,18 +49,18 @@ void AnalyzerInformation::writeFilesTxt(const std::string &buildDir, const std:: const std::string filesTxt(buildDir + "/files.txt"); std::ofstream fout(filesTxt); - for (std::list::const_iterator f = sourcefiles.begin(); f != sourcefiles.end(); ++f) { - const std::string afile = getFilename(*f); + for (const std::string &f : sourcefiles) { + const std::string afile = getFilename(f); if (fileCount.find(afile) == fileCount.end()) fileCount[afile] = 0; - fout << afile << ".a" << (++fileCount[afile]) << "::" << Path::fromNativeSeparators(*f) << '\n'; + fout << afile << ".a" << (++fileCount[afile]) << "::" << Path::fromNativeSeparators(f) << '\n'; } - for (std::list::const_iterator fs = fileSettings.begin(); fs != fileSettings.end(); ++fs) { - const std::string afile = getFilename(fs->filename); + for (const ImportProject::FileSettings &fs : fileSettings) { + const std::string afile = getFilename(fs.filename); if (fileCount.find(afile) == fileCount.end()) fileCount[afile] = 0; - fout << afile << ".a" << (++fileCount[afile]) << ":" << fs->cfg << ":" << Path::fromNativeSeparators(fs->filename) << std::endl; + fout << afile << ".a" << (++fileCount[afile]) << ":" << fs.cfg << ":" << Path::fromNativeSeparators(fs.filename) << std::endl; } }