summaryrefslogtreecommitdiffstats
path: root/Source/cmcmd.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-09-18 18:11:19 (GMT)
committerBrad King <brad.king@kitware.com>2017-09-19 13:32:25 (GMT)
commit706b37b7f597f449cc3d02bd50123c4e7277eadb (patch)
treebbb9c41b56c4205e8c28578f8b13ee6aa4ad0825 /Source/cmcmd.cxx
parent4547d9a83030f8ae7e636cef16a261c65e6feb40 (diff)
downloadCMake-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.cxx7
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());