diff options
author | Brad King <brad.king@kitware.com> | 2017-09-18 18:11:19 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-09-19 13:32:25 (GMT) |
commit | 706b37b7f597f449cc3d02bd50123c4e7277eadb (patch) | |
tree | bbb9c41b56c4205e8c28578f8b13ee6aa4ad0825 /Source/cmcmd.cxx | |
parent | 4547d9a83030f8ae7e636cef16a261c65e6feb40 (diff) | |
download | CMake-706b37b7f597f449cc3d02bd50123c4e7277eadb.zip CMake-706b37b7f597f449cc3d02bd50123c4e7277eadb.tar.gz CMake-706b37b7f597f449cc3d02bd50123c4e7277eadb.tar.bz2 |
Enable clang-tidy modernize-loop-convert lint
Fix remaining diagnostics by this lint and remove it from our list of
disabled lints.
Diffstat (limited to 'Source/cmcmd.cxx')
-rw-r--r-- | Source/cmcmd.cxx | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 26868bc..e152cdb 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -282,8 +282,7 @@ int cmcmd::HandleCppCheck(const std::string& runCmd, std::vector<std::string> cppcheck_cmd; cmSystemTools::ExpandListArgument(runCmd, cppcheck_cmd, true); // extract all the -D, -U, and -I options from the compile line - for (size_t i = 0; i < orig_cmd.size(); i++) { - const std::string& opt = orig_cmd[i]; + for (auto const& opt : orig_cmd) { if (opt.size() > 2) { if ((opt[0] == '-') && ((opt[1] == 'D') || (opt[1] == 'I') || (opt[1] == 'U'))) { @@ -367,9 +366,7 @@ int cmcmd::HandleCoCompileCommands(std::vector<std::string>& args) } else if (doing_options) { bool optionFound = false; // check arg against all the commandOptions - for (std::vector<std::string>::size_type i = 0; - i < commandOptions.size(); ++i) { - const std::string& command = commandOptions[i]; + for (auto const& command : commandOptions) { if (arg.compare(0, command.size(), command) == 0) { optionFound = true; runCmd = arg.substr(command.size()); |