summaryrefslogtreecommitdiff
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-02-11 13:08:13 +0000
committerKitware Robot <kwrobot@kitware.com>2019-02-11 08:08:22 -0500
commit4b37b4f1bb785a305ab742f37e5268d4cffef693 (patch)
treef9c6e15ac0925bfa8b15fce4c3475d3233a820f6 /Source/cmSystemTools.cxx
parent17de1eea806d7ba87a4ba6ad1073ced5f7ea9473 (diff)
parent01b2d6ab7465e7f22fb821876027df86b0c8f363 (diff)
downloadcmake-4b37b4f1bb785a305ab742f37e5268d4cffef693.tar.gz
Merge topic 'modernize-for-loops'
01b2d6ab74 Modernize: Use ranged for-loops when possible 15bdbec017 cmAlgorithms: Make cmRange advance/retreat safe for rvalues Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de> Merge-request: !2901
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 89bf2f8967..2d7bce4994 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) {
@@ -1220,9 +1219,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);
}
}