diff options
author | Pavel Solodovnikov <hellyeahdominate@gmail.com> | 2017-09-11 10:40:26 (GMT) |
---|---|---|
committer | Pavel Solodovnikov <hellyeahdominate@gmail.com> | 2017-09-12 13:22:47 (GMT) |
commit | 7d5095796ab616cf9b709036387bb95ab9984141 (patch) | |
tree | c010e922adad95ef86ab4a3ac2a3abd63e9f33ef /Source/cmSourceFile.cxx | |
parent | 00975e926199eea21763470e2ab876246e36669a (diff) | |
download | CMake-7d5095796ab616cf9b709036387bb95ab9984141.zip CMake-7d5095796ab616cf9b709036387bb95ab9984141.tar.gz CMake-7d5095796ab616cf9b709036387bb95ab9984141.tar.bz2 |
Meta: modernize old-fashioned loops to range-based `for`.
Changes done via `clang-tidy` with some manual fine-tuning
for the variable naming and `auto` type deduction
where appropriate.
Diffstat (limited to 'Source/cmSourceFile.cxx')
-rw-r--r-- | Source/cmSourceFile.cxx | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 6d2b98d..0964bea 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -150,15 +150,13 @@ bool cmSourceFile::FindFullPath(std::string* error) if (this->TryFullPath(tryPath, "")) { return true; } - for (std::vector<std::string>::const_iterator ei = srcExts.begin(); - ei != srcExts.end(); ++ei) { - if (this->TryFullPath(tryPath, *ei)) { + for (std::string const& ext : srcExts) { + if (this->TryFullPath(tryPath, ext)) { return true; } } - for (std::vector<std::string>::const_iterator ei = hdrExts.begin(); - ei != hdrExts.end(); ++ei) { - if (this->TryFullPath(tryPath, *ei)) { + for (std::string const& ext : hdrExts) { + if (this->TryFullPath(tryPath, ext)) { return true; } } @@ -171,13 +169,11 @@ bool cmSourceFile::FindFullPath(std::string* error) } missing += this->Location.GetName(); e << "Cannot find source file:\n " << missing << "\nTried extensions"; - for (std::vector<std::string>::const_iterator ext = srcExts.begin(); - ext != srcExts.end(); ++ext) { - e << " ." << *ext; + for (std::string const& srcExt : srcExts) { + e << " ." << srcExt; } - for (std::vector<std::string>::const_iterator ext = hdrExts.begin(); - ext != hdrExts.end(); ++ext) { - e << " ." << *ext; + for (std::string const& ext : hdrExts) { + e << " ." << ext; } if (error) { *error = e.str(); |