From cbbca9ee2aba6fa08a3931c69fde92b7b9b273c0 Mon Sep 17 00:00:00 2001 From: Vitaly Stakhovsky Date: Mon, 9 Mar 2020 12:00:00 -0400 Subject: [PATCH] Convert more loops to range-based for-loops --- Source/cmLocalGenerator.cxx | 6 +++--- Source/cmLocalVisualStudio7Generator.cxx | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index cf6802db76..a7799b6fd4 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2914,11 +2914,11 @@ void cmLocalGenerator::JoinDefines(const std::set& defines, // command line without any escapes. However we still have to // get the '$' and '#' characters through WMake as '$$' and // '$#'. - for (const char* c = define.c_str(); *c; ++c) { - if (*c == '$' || *c == '#') { + for (char c : define) { + if (c == '$' || c == '#') { def += '$'; } - def += *c; + def += c; } } else { // Make the definition appear properly on the command line. Use diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 0572e07afe..74219b53e5 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1510,10 +1510,9 @@ cmLocalVisualStudio7GeneratorFCInfo::cmLocalVisualStudio7GeneratorFCInfo( if (const char* deps = sf.GetProperty("OBJECT_DEPENDS")) { std::vector depends = cmExpandedList(deps); const char* sep = ""; - for (std::vector::iterator j = depends.begin(); - j != depends.end(); ++j) { + for (const std::string& d : depends) { fc.AdditionalDeps += sep; - fc.AdditionalDeps += lg->ConvertToXMLOutputPath(*j); + fc.AdditionalDeps += lg->ConvertToXMLOutputPath(d); sep = ";"; needfc = true; }