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/cmCustomCommandGenerator.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/cmCustomCommandGenerator.cxx')
-rw-r--r-- | Source/cmCustomCommandGenerator.cxx | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx index fdc0a97..9e26cd2 100644 --- a/Source/cmCustomCommandGenerator.cxx +++ b/Source/cmCustomCommandGenerator.cxx @@ -24,12 +24,10 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc, , GE(new cmGeneratorExpression(cc.GetBacktrace())) { const cmCustomCommandLines& cmdlines = this->CC.GetCommandLines(); - for (cmCustomCommandLines::const_iterator cmdline = cmdlines.begin(); - cmdline != cmdlines.end(); ++cmdline) { + for (cmCustomCommandLine const& cmdline : cmdlines) { cmCustomCommandLine argv; - for (cmCustomCommandLine::const_iterator clarg = cmdline->begin(); - clarg != cmdline->end(); ++clarg) { - CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = this->GE->Parse(*clarg); + for (std::string const& clarg : cmdline) { + CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = this->GE->Parse(clarg); std::string parsed_arg = cge->Evaluate(this->LG, this->Config); if (this->CC.GetCommandExpandLists()) { std::vector<std::string> ExpandedArg; @@ -43,16 +41,14 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc, } std::vector<std::string> depends = this->CC.GetDepends(); - for (std::vector<std::string>::const_iterator i = depends.begin(); - i != depends.end(); ++i) { - CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = this->GE->Parse(*i); + for (std::string const& d : depends) { + CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = this->GE->Parse(d); std::vector<std::string> result; cmSystemTools::ExpandListArgument(cge->Evaluate(this->LG, this->Config), result); - for (std::vector<std::string>::iterator it = result.begin(); - it != result.end(); ++it) { - if (cmSystemTools::FileIsFullPath(it->c_str())) { - *it = cmSystemTools::CollapseFullPath(*it); + for (std::string& it : result) { + if (cmSystemTools::FileIsFullPath(it.c_str())) { + it = cmSystemTools::CollapseFullPath(it); } } this->Depends.insert(this->Depends.end(), result.begin(), result.end()); |