Skip to content

Commit 5712366

Browse files
committed
refactoring; use range for loops
1 parent 41d4a6b commit 5712366

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

lib/analyzerinfo.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,18 @@ void AnalyzerInformation::writeFilesTxt(const std::string &buildDir, const std::
4949

5050
const std::string filesTxt(buildDir + "/files.txt");
5151
std::ofstream fout(filesTxt);
52-
for (std::list<std::string>::const_iterator f = sourcefiles.begin(); f != sourcefiles.end(); ++f) {
53-
const std::string afile = getFilename(*f);
52+
for (const std::string &f : sourcefiles) {
53+
const std::string afile = getFilename(f);
5454
if (fileCount.find(afile) == fileCount.end())
5555
fileCount[afile] = 0;
56-
fout << afile << ".a" << (++fileCount[afile]) << "::" << Path::fromNativeSeparators(*f) << '\n';
56+
fout << afile << ".a" << (++fileCount[afile]) << "::" << Path::fromNativeSeparators(f) << '\n';
5757
}
5858

59-
for (std::list<ImportProject::FileSettings>::const_iterator fs = fileSettings.begin(); fs != fileSettings.end(); ++fs) {
60-
const std::string afile = getFilename(fs->filename);
59+
for (const ImportProject::FileSettings &fs : fileSettings) {
60+
const std::string afile = getFilename(fs.filename);
6161
if (fileCount.find(afile) == fileCount.end())
6262
fileCount[afile] = 0;
63-
fout << afile << ".a" << (++fileCount[afile]) << ":" << fs->cfg << ":" << Path::fromNativeSeparators(fs->filename) << std::endl;
63+
fout << afile << ".a" << (++fileCount[afile]) << ":" << fs.cfg << ":" << Path::fromNativeSeparators(fs.filename) << std::endl;
6464
}
6565
}
6666

0 commit comments

Comments
 (0)