diff options
author | Pavel Solodovnikov <hellyeahdominate@gmail.com> | 2017-09-11 13:40:26 +0300 |
---|---|---|
committer | Pavel Solodovnikov <hellyeahdominate@gmail.com> | 2017-09-12 16:22:47 +0300 |
commit | 7d5095796ab616cf9b709036387bb95ab9984141 (patch) | |
tree | c010e922adad95ef86ab4a3ac2a3abd63e9f33ef /Source/cmCMakeMinimumRequired.cxx | |
parent | 00975e926199eea21763470e2ab876246e36669a (diff) | |
download | cmake-7d5095796ab616cf9b709036387bb95ab9984141.tar.gz |
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/cmCMakeMinimumRequired.cxx')
-rw-r--r-- | Source/cmCMakeMinimumRequired.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/cmCMakeMinimumRequired.cxx b/Source/cmCMakeMinimumRequired.cxx index 942688ceeb..bcc41fca91 100644 --- a/Source/cmCMakeMinimumRequired.cxx +++ b/Source/cmCMakeMinimumRequired.cxx @@ -19,10 +19,10 @@ bool cmCMakeMinimumRequired::InitialPass(std::vector<std::string> const& args, // Process arguments. std::string version_string; bool doing_version = false; - for (unsigned int i = 0; i < args.size(); ++i) { - if (args[i] == "VERSION") { + for (std::string const& arg : args) { + if (arg == "VERSION") { doing_version = true; - } else if (args[i] == "FATAL_ERROR") { + } else if (arg == "FATAL_ERROR") { if (doing_version) { this->SetError("called with no value for VERSION."); return false; @@ -30,9 +30,9 @@ bool cmCMakeMinimumRequired::InitialPass(std::vector<std::string> const& args, doing_version = false; } else if (doing_version) { doing_version = false; - version_string = args[i]; + version_string = arg; } else { - this->UnknownArguments.push_back(args[i]); + this->UnknownArguments.push_back(arg); } } if (doing_version) { |