summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorArtur Ryt <artur.ryt@gmail.com>2019-02-07 21:39:05 (GMT)
committerArtur Ryt <artur.ryt@gmail.com>2019-02-07 21:39:05 (GMT)
commit01b2d6ab7465e7f22fb821876027df86b0c8f363 (patch)
tree7ae313670e3655269ef7f9db6feabdc4bb2aaf25 /Source/cmSystemTools.cxx
parent15bdbec0176e3aa620bb5bda3631819c5ca18eaf (diff)
downloadCMake-01b2d6ab7465e7f22fb821876027df86b0c8f363.zip
CMake-01b2d6ab7465e7f22fb821876027df86b0c8f363.tar.gz
CMake-01b2d6ab7465e7f22fb821876027df86b0c8f363.tar.bz2
Modernize: Use ranged for-loops when possible
Replaced most manual `const_iterator`-based loops and some reverse-iterator loops with range loops. Fixes: #18858
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index ba40ce1..aa4e3f9 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -542,8 +542,7 @@ std::vector<std::string> cmSystemTools::HandleResponseFile(
std::vector<std::string>::const_iterator argEnd)
{
std::vector<std::string> arg_full;
- for (std::vector<std::string>::const_iterator a = argBeg; a != argEnd; ++a) {
- std::string const& arg = *a;
+ for (std::string const& arg : cmMakeRange(argBeg, argEnd)) {
if (cmHasLiteralPrefix(arg, "@")) {
cmsys::ifstream responseFile(arg.substr(1).c_str(), std::ios::in);
if (!responseFile) {
@@ -1219,9 +1218,8 @@ void cmSystemTools::GlobDirs(const std::string& path,
void cmSystemTools::ExpandList(std::vector<std::string> const& arguments,
std::vector<std::string>& newargs)
{
- std::vector<std::string>::const_iterator i;
- for (i = arguments.begin(); i != arguments.end(); ++i) {
- cmSystemTools::ExpandListArgument(*i, newargs);
+ for (std::string const& arg : arguments) {
+ cmSystemTools::ExpandListArgument(arg, newargs);
}
}