Commit 7d509579 authored by Pavel Solodovnikov's avatar Pavel Solodovnikov

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.
parent 00975e92
......@@ -394,12 +394,10 @@ bool bindexplib::AddDefinitionFile(const char* filename)
void bindexplib::WriteFile(FILE* file)
{
fprintf(file, "EXPORTS \n");
for (std::set<std::string>::const_iterator i = this->DataSymbols.begin();
i != this->DataSymbols.end(); ++i) {
fprintf(file, "\t%s \t DATA\n", i->c_str());
for (std::string const& ds : this->DataSymbols) {
fprintf(file, "\t%s \t DATA\n", ds.c_str());
}
for (std::set<std::string>::const_iterator i = this->Symbols.begin();
i != this->Symbols.end(); ++i) {
fprintf(file, "\t%s\n", i->c_str());
for (std::string const& s : this->Symbols) {
fprintf(file, "\t%s\n", s.c_str());
}
}
......@@ -13,9 +13,8 @@ bool cmAddCompileOptionsCommand::InitialPass(
return true;
}
for (std::vector<std::string>::const_iterator i = args.begin();
i != args.end(); ++i) {
this->Makefile->AddCompileOption(i->c_str());
for (std::string const& i : args) {
this->Makefile->AddCompileOption(i.c_str());
}
return true;
}
......@@ -68,9 +68,7 @@ bool cmAddCustomCommandCommand::InitialPass(
tdoing doing = doing_nothing;
for (unsigned int j = 0; j < args.size(); ++j) {
std::string const& copy = args[j];
for (std::string const& copy : args) {
if (copy == "SOURCE") {
doing = doing_source;
} else if (copy == "COMMAND") {
......@@ -355,12 +353,11 @@ bool cmAddCustomCommandCommand::InitialPass(
bool cmAddCustomCommandCommand::CheckOutputs(
const std::vector<std::string>& outputs)
{
for (std::vector<std::string>::const_iterator o = outputs.begin();
o != outputs.end(); ++o) {
for (std::string const& o : outputs) {
// Make sure the file will not be generated into the source
// directory during an out of source build.
if (!this->Makefile->CanIWriteThisFile(o->c_str())) {
std::string e = "attempted to have a file \"" + *o +
if (!this->Makefile->CanIWriteThisFile(o.c_str())) {
std::string e = "attempted to have a file \"" + o +
"\" in a source directory as an output of custom command.";
this->SetError(e);
cmSystemTools::SetFatalErrorOccured();
......@@ -368,10 +365,10 @@ bool cmAddCustomCommandCommand::CheckOutputs(
}
// Make sure the output file name has no invalid characters.
std::string::size_type pos = o->find_first_of("#<>");
std::string::size_type pos = o.find_first_of("#<>");
if (pos != std::string::npos) {
std::ostringstream msg;
msg << "called with OUTPUT containing a \"" << (*o)[pos]
msg << "called with OUTPUT containing a \"" << o[pos]
<< "\". This character is not allowed.";
this->SetError(msg.str());
return false;
......
......@@ -15,9 +15,8 @@ bool cmAddDefinitionsCommand::InitialPass(std::vector<std::string> const& args,
return true;
}
for (std::vector<std::string>::const_iterator i = args.begin();
i != args.end(); ++i) {
this->Makefile->AddDefineFlag(i->c_str());
for (std::string const& i : args) {
this->Makefile->AddDefineFlag(i.c_str());
}
return true;
}
......@@ -45,10 +45,9 @@ void cmCLocaleEnvironmentScope::SetEnv(std::string const& key,
cmCLocaleEnvironmentScope::~cmCLocaleEnvironmentScope()
{
for (backup_map_t::const_iterator i = this->EnvironmentBackup.begin();
i != this->EnvironmentBackup.end(); ++i) {
for (auto const& envb : this->EnvironmentBackup) {
std::ostringstream tmp;
tmp << i->first << "=" << i->second;
tmp << envb.first << "=" << envb.second;
cmSystemTools::PutEnv(tmp.str());
}
}
......@@ -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) {
......
......@@ -6,7 +6,6 @@
#include <map>
#include <ostream>
#include <utility>
cmCPackPropertiesGenerator::cmCPackPropertiesGenerator(
cmLocalGenerator* lg, cmInstalledFile const& installedFile,
......@@ -27,19 +26,17 @@ void cmCPackPropertiesGenerator::GenerateScriptForConfig(
cmInstalledFile::PropertyMapType const& properties =
this->InstalledFile.GetProperties();
for (cmInstalledFile::PropertyMapType::const_iterator i = properties.begin();
i != properties.end(); ++i) {
std::string const& name = i->first;
cmInstalledFile::Property const& property = i->second;
for (cmInstalledFile::PropertyMapType::value_type const& i : properties) {
std::string const& name = i.first;
cmInstalledFile::Property const& property = i.second;
os << indent << "set_property(INSTALL "
<< cmOutputConverter::EscapeForCMake(expandedFileName) << " PROPERTY "
<< cmOutputConverter::EscapeForCMake(name);
for (cmInstalledFile::ExpressionVectorType::const_iterator j =
property.ValueExpressions.begin();
j != property.ValueExpressions.end(); ++j) {
std::string value = (*j)->Evaluate(this->LG, config);
for (cmInstalledFile::ExpressionVectorType::value_type const& j :
property.ValueExpressions) {
std::string value = j->Evaluate(this->LG, config);
os << " " << cmOutputConverter::EscapeForCMake(value);
}
......
......@@ -504,8 +504,8 @@ public:
typedef derived::value_type value_type;
~cmCPluginAPISourceFileMap()
{
for (iterator i = this->begin(); i != this->end(); ++i) {
delete i->second;
for (auto const& i : *this) {
delete i.second;
}
}
};
......@@ -568,9 +568,8 @@ void* CCONV cmAddSource(void* arg, void* arg2)
// Create the real cmSourceFile instance and copy over saved information.
cmSourceFile* rsf = mf->GetOrCreateSource(osf->FullPath);
rsf->GetProperties() = osf->Properties;
for (std::vector<std::string>::iterator i = osf->Depends.begin();
i != osf->Depends.end(); ++i) {
rsf->AddDepend(*i);
for (std::string const& d : osf->Depends) {
rsf->AddDepend(d);
}
// Create the proxy for the real source file.
......
......@@ -222,8 +222,7 @@ std::string cmCTest::MakeURLSafe(const std::string& str)
{
std::ostringstream ost;
char buffer[10];
for (std::string::size_type pos = 0; pos < str.size(); pos++) {
unsigned char ch = str[pos];
for (unsigned char ch : str) {
if ((ch > 126 || ch < 32 || ch == '&' || ch == '%' || ch == '+' ||
ch == '=' || ch == '@') &&
ch != 9) {
......@@ -973,9 +972,8 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output,
}
std::vector<const char*> argv;
for (std::vector<std::string>::const_iterator a = args.begin();
a != args.end(); ++a) {
argv.push_back(a->c_str());
for (std::string const& a : args) {
argv.push_back(a.c_str());
}
argv.push_back(nullptr);
......@@ -1009,9 +1007,9 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output,
<< " " << std::flush);
while (cmsysProcess_WaitForData(cp, &data, &length, nullptr)) {
processOutput.DecodeText(data, length, strdata);
for (size_t cc = 0; cc < strdata.size(); ++cc) {
if (strdata[cc] == 0) {
strdata[cc] = '\n';
for (char& cc : strdata) {
if (cc == 0) {
cc = '\n';
}
}
output.append(strdata);
......@@ -1107,18 +1105,18 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
inst.SetStreams(&oss, &oss);
std::vector<std::string> args;
for (unsigned int i = 0; i < argv.size(); ++i) {
if (argv[i]) {
for (char const* i : argv) {
if (i) {
// make sure we pass the timeout in for any build and test
// invocations. Since --build-generator is required this is a
// good place to check for it, and to add the arguments in
if (strcmp(argv[i], "--build-generator") == 0 && timeout > 0) {
if (strcmp(i, "--build-generator") == 0 && timeout > 0) {
args.push_back("--test-timeout");
std::ostringstream msg;
msg << timeout;
args.push_back(msg.str());
}
args.push_back(argv[i]);
args.push_back(i);
}
}
if (log) {
......@@ -1348,9 +1346,8 @@ void cmCTest::AddSiteProperties(cmXMLWriter& xml)
std::string l = labels;
std::vector<std::string> args;
cmSystemTools::ExpandListArgument(l, args);
for (std::vector<std::string>::iterator i = args.begin();
i != args.end(); ++i) {
xml.Element("Label", *i);
for (std::string const& i : args) {
xml.Element("Label", i);
}
xml.EndElement();
}
......@@ -2352,9 +2349,8 @@ void cmCTest::PopulateCustomVector(cmMakefile* mf, const std::string& def,
vec.clear();
cmSystemTools::ExpandListArgument(dval, vec);
for (std::vector<std::string>::const_iterator it = vec.begin();
it != vec.end(); ++it) {
cmCTestLog(this, DEBUG, " -- " << *it << std::endl);
for (std::string const& it : vec) {
cmCTestLog(this, DEBUG, " -- " << it << std::endl);
}
}
......@@ -2592,9 +2588,8 @@ bool cmCTest::RunCommand(const char* command, std::string* stdOut,
}
std::vector<const char*> argv;
for (std::vector<std::string>::const_iterator a = args.begin();
a != args.end(); ++a) {
argv.push_back(a->c_str());
for (std::string const& a : args) {
argv.push_back(a.c_str());
}
argv.push_back(nullptr);
......
......@@ -297,10 +297,8 @@ bool cmCacheManager::SaveCache(const std::string& path)
fout << "########################\n";
fout << "\n";
for (std::map<std::string, CacheEntry>::const_iterator i =
this->Cache.begin();
i != this->Cache.end(); ++i) {
const CacheEntry& ce = (*i).second;
for (auto const& i : this->Cache) {
CacheEntry const& ce = i.second;
cmStateEnums::CacheEntryType t = ce.Type;
if (!ce.Initialized) {
/*
......@@ -315,7 +313,7 @@ bool cmCacheManager::SaveCache(const std::string& path)
} else {
cmCacheManager::OutputHelpString(fout, "Missing description");
}
this->OutputKey(fout, i->first);
this->OutputKey(fout, i.first);
fout << ":" << cmState::CacheEntryTypeToString(t) << "=";
this->OutputValue(fout, ce.Value);
fout << "\n\n";
......@@ -462,11 +460,9 @@ void cmCacheManager::PrintCache(std::ostream& out) const
{
out << "=================================================" << std::endl;
out << "CMakeCache Contents:" << std::endl;
for (std::map<std::string, CacheEntry>::const_iterator i =
this->Cache.begin();
i != this->Cache.end(); ++i) {
if ((*i).second.Type != cmStateEnums::INTERNAL) {
out << (*i).first << " = " << (*i).second.Value << std::endl;
for (auto const& i : this->Cache) {
if (i.second.Type != cmStateEnums::INTERNAL) {
out << i.first << " = " << i.second.Value << std::endl;
}
}
out << "\n\n";
......@@ -494,11 +490,10 @@ void cmCacheManager::AddCacheEntry(const std::string& key, const char* value,
cmSystemTools::ExpandListArgument(e.Value, paths);
const char* sep = "";
e.Value = "";
for (std::vector<std::string>::iterator i = paths.begin();
i != paths.end(); ++i) {
cmSystemTools::ConvertToUnixSlashes(*i);
for (std::string& i : paths) {
cmSystemTools::ConvertToUnixSlashes(i);
e.Value += sep;
e.Value += *i;
e.Value += i;
sep = ";";
}
} else {
......
......@@ -258,8 +258,8 @@ int cmCommandArgumentParserHelper::ParseString(const char* str, int verb)
void cmCommandArgumentParserHelper::CleanupParser()
{
std::vector<char*>::iterator sit;
for (sit = this->Variables.begin(); sit != this->Variables.end(); ++sit) {
delete[] * sit;
for (char* var : this->Variables) {
delete[] var;
}
this->Variables.erase(this->Variables.begin(), this->Variables.end());
}
......
......@@ -61,11 +61,9 @@ bool cmCommandArgument::KeyMatches(const std::string& key) const
void cmCommandArgument::ApplyOwnGroup()
{
if (this->Group != nullptr) {
for (std::vector<cmCommandArgument*>::const_iterator it =
this->Group->ContainedArguments.begin();
it != this->Group->ContainedArguments.end(); ++it) {
if (*it != this) {
this->ArgumentsBefore.insert(*it);
for (cmCommandArgument* cargs : this->Group->ContainedArguments) {
if (cargs != this) {
this->ArgumentsBefore.insert(cargs);
}
}
}
......@@ -180,19 +178,15 @@ void cmCADisabler::DoReset()
void cmCommandArgumentGroup::Follows(const cmCommandArgument* arg)
{
for (std::vector<cmCommandArgument*>::iterator it =
this->ContainedArguments.begin();
it != this->ContainedArguments.end(); ++it) {
(*it)->Follows(arg);
for (cmCommandArgument* ca : this->ContainedArguments) {
ca->Follows(arg);
}
}
void cmCommandArgumentGroup::FollowsGroup(const cmCommandArgumentGroup* group)
{
for (std::vector<cmCommandArgument*>::iterator it =
this->ContainedArguments.begin();
it != this->ContainedArguments.end(); ++it) {
(*it)->FollowsGroup(group);
for (cmCommandArgument* ca : this->ContainedArguments) {
ca->FollowsGroup(group);
}
}
......@@ -203,37 +197,31 @@ void cmCommandArgumentsHelper::Parse(const std::vector<std::string>* args,
return;
}
for (std::vector<cmCommandArgument*>::iterator argIt =
this->Arguments.begin();
argIt != this->Arguments.end(); ++argIt) {
(*argIt)->ApplyOwnGroup();
(*argIt)->Reset();
for (cmCommandArgument* ca : this->Arguments) {
ca->ApplyOwnGroup();
ca->Reset();
}
cmCommandArgument* activeArgument = nullptr;
const cmCommandArgument* previousArgument = nullptr;
for (std::vector<std::string>::const_iterator it = args->begin();
it != args->end(); ++it) {
for (std::vector<cmCommandArgument*>::iterator argIt =
this->Arguments.begin();
argIt != this->Arguments.end(); ++argIt) {
if ((*argIt)->KeyMatches(*it) &&
((*argIt)->MayFollow(previousArgument))) {
activeArgument = *argIt;
for (std::string const& it : *args) {
for (cmCommandArgument* ca : this->Arguments) {
if (ca->KeyMatches(it) && (ca->MayFollow(previousArgument))) {
activeArgument = ca;
activeArgument->Activate();
break;
}
}
if (activeArgument) {
bool argDone = activeArgument->Consume(*it);
bool argDone = activeArgument->Consume(it);
previousArgument = activeArgument;
if (argDone) {
activeArgument = nullptr;
}
} else {
if (unconsumedArgs != nullptr) {
unconsumedArgs->push_back(*it);
unconsumedArgs->push_back(it);
}
}
}
......
......@@ -147,10 +147,8 @@ std::vector<std::string> cmCommonTargetGenerator::GetLinkedTargetDirectories()
if (cmComputeLinkInformation* cli =
this->GeneratorTarget->GetLinkInformation(this->ConfigName)) {
cmComputeLinkInformation::ItemVector const& items = cli->GetItems();
for (cmComputeLinkInformation::ItemVector::const_iterator i =
items.begin();
i != items.end(); ++i) {
cmGeneratorTarget const* linkee = i->Target;
for (auto const& item : items) {
cmGeneratorTarget const* linkee = item.Target;
if (linkee && !linkee->IsImported()
// We can ignore the INTERFACE_LIBRARY items because
// Target->GetLinkInformation already processed their
......@@ -196,12 +194,11 @@ std::string cmCommonTargetGenerator::GetManifests()
this->GeneratorTarget->GetManifests(manifest_srcs, this->ConfigName);
std::vector<std::string> manifests;
for (std::vector<cmSourceFile const*>::iterator mi = manifest_srcs.begin();
mi != manifest_srcs.end(); ++mi) {
for (cmSourceFile const* manifest_src : manifest_srcs) {
manifests.push_back(this->LocalCommonGenerator->ConvertToOutputFormat(
this->LocalCommonGenerator->ConvertToRelativePath(
this->LocalCommonGenerator->GetWorkingDirectory(),
(*mi)->GetFullPath()),
manifest_src->GetFullPath()),
cmOutputConverter::SHELL));
}
......
......@@ -57,8 +57,8 @@ void cmComputeComponentGraph::TarjanVisit(int i)
// Follow outgoing edges.
EdgeList const& nl = this->InputGraph[i];
for (EdgeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni) {
int j = *ni;
for (cmGraphEdge const& ni : nl) {
int j = ni;
// Ignore edges to nodes that have been reached by a previous DFS
// walk. Since we did not reach the current node from that walk
......@@ -119,14 +119,14 @@ void cmComputeComponentGraph::TransferEdges()
for (int i = 0; i < n; ++i) {
int i_component = this->TarjanComponents[i];
EdgeList const& nl = this->InputGraph[i];
for (EdgeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni) {
int j = *ni;
for (cmGraphEdge const& ni : nl) {
int j = ni;
int j_component = this->TarjanComponents[j];
if (i_component != j_component) {
// We do not attempt to combine duplicate edges, but instead
// store the inter-component edges with suitable multiplicity.
this->ComponentGraph[i_component].push_back(
cmGraphEdge(j_component, ni->IsStrong()));
cmGraphEdge(j_component, ni.IsStrong()));
}
}
}
......
......@@ -357,10 +357,8 @@ void cmComputeLinkDepends::FollowLinkEntry(BFSEntry qe)
this->FollowSharedDeps(depender_index, iface);
// Support for CMP0003.
for (std::vector<cmLinkItem>::const_iterator oi =
iface->WrongConfigLibraries.begin();
oi != iface->WrongConfigLibraries.end(); ++oi) {
this->CheckWrongConfigItem(*oi);
for (cmLinkItem const& oi : iface->WrongConfigLibraries) {
this->CheckWrongConfigItem(oi);
}
}
} else {
......@@ -385,10 +383,9 @@ void cmComputeLinkDepends::FollowSharedDeps(int depender_index,
void cmComputeLinkDepends::QueueSharedDependencies(
int depender_index, std::vector<cmLinkItem> const& deps)
{
for (std::vector<cmLinkItem>::const_iterator li = deps.begin();
li != deps.end(); ++li) {
for (cmLinkItem const& li : deps) {
SharedDepEntry qe;
qe.Item = *li;
qe.Item = li;
qe.DependerIndex = depender_index;
this->SharedDepQueue.push(qe);
}
......@@ -445,25 +442,24 @@ void cmComputeLinkDepends::AddVarLinkEntries(int depender_index,
std::vector<cmLinkItem> actual_libs;
cmTargetLinkLibraryType llt = GENERAL_LibraryType;
bool haveLLT = false;
for (std::vector<std::string>::const_iterator di = deplist.begin();
di != deplist.end(); ++di) {
if (*di == "debug") {
for (std::string const& d : deplist) {
if (d == "debug") {
llt = DEBUG_LibraryType;
haveLLT = true;
} else if (*di == "optimized") {
} else if (d == "optimized") {
llt = OPTIMIZED_LibraryType;
haveLLT = true;
} else if (*di == "general") {
} else if (d == "general") {
llt = GENERAL_LibraryType;
haveLLT = true;
} else if (!di->empty()) {
} else if (!d.empty()) {
// If no explicit link type was given prior to this entry then
// check if the entry has its own link type variable. This is
// needed for compatibility with dependency files generated by
// the export_library_dependencies command from CMake 2.4 and
// lower.
if (!haveLLT) {
std::string var = *di;
std::string var = d;
var += "_LINK_TYPE";
if (const char* val = this->Makefile->GetDefinition(var)) {
if (strcmp(val, "debug") == 0) {
......@@ -476,10 +472,10 @@ void cmComputeLinkDepends::AddVarLinkEntries(int depender_index,
// If the library is meant for this link type then use it.
if (llt == GENERAL_LibraryType || llt == this->LinkType) {
cmLinkItem item(*di, this->FindTargetToLink(depender_index, *di));
cmLinkItem item(d, this->FindTargetToLink(depender_index, d));
actual_libs.push_back(item);
} else if (this->OldLinkDirMode) {
cmLinkItem item(*di, this->FindTargetToLink(depender_index, *di));
cmLinkItem item(d, this->FindTargetToLink(depender_index, d));
this->CheckWrongConfigItem(item);
}
......@@ -499,10 +495,8 @@ void cmComputeLinkDepends::AddDirectLinkEntries()
cmLinkImplementation const* impl =
this->Target->GetLinkImplementation(this->Config);
this->AddLinkEntries(-1, impl->Libraries);
for (std::vector<cmLinkItem>::const_iterator wi =
impl->WrongConfigLibraries.begin();
wi != impl->WrongConfigLibraries.end(); ++wi) {
this->CheckWrongConfigItem(*wi);
for (cmLinkItem const& wi : impl->WrongConfigLibraries) {
this->CheckWrongConfigItem(wi);
}
}
......@@ -514,17 +508,16 @@ void cmComputeLinkDepends::AddLinkEntries(int depender_index,
std::map<int, DependSet> dependSets;
// Loop over the libraries linked directly by the depender.
for (typename std::vector<T>::const_iterator li = libs.begin();
li != libs.end(); ++li) {
for (T const& l : libs) {
// Skip entries that will resolve to the target getting linked or
// are empty.
cmLinkItem const& item = *li;
cmLinkItem const& item = l;
if (item == this->Target->GetName() || item.empty()) {
continue;
}
// Add a link entry for this item.
int dependee_index = this->AddLinkEntry(*li);
int dependee_index = this->AddLinkEntry(l);
// The dependee must come after the depender.
if (depender_index >= 0) {
......@@ -535,16 +528,15 @@ void cmComputeLinkDepends::AddLinkEntries(int depender_index,
}
// Update the inferred dependencies for earlier items.
for (std::map<int, DependSet>::iterator dsi = dependSets.begin();
dsi != dependSets.end(); ++dsi) {
for (auto& dependSet : dependSets) {
// Add this item to the inferred dependencies of other items.
// Target items are never inferred dependees because unknown
// items are outside libraries that should not be depending on
// targets.
if (!this->EntryList[dependee_index].Target &&
!this->EntryList[dependee_index].IsFlag &&
dependee_index != dsi->first) {
dsi->second.insert(dependee_index);
dependee_index != dependSet.first) {
dependSet.second.insert(dependee_index);
}
}
......@@ -556,9 +548,8 @@ void cmComputeLinkDepends::AddLinkEntries(int depender_index,
}
// Store the inferred dependency sets discovered for this list.
for (std::map<int, DependSet>::iterator dsi = dependSets.begin();
dsi != dependSets.end(); ++dsi) {
this->InferredDependSets[dsi->first]->push_back(dsi->second);
for (auto const& dependSet : dependSets) {
this->InferredDependSets[dependSet.first]->push_back(dependSet.second);
}
}
......@@ -608,14 +599,14 @@ void cmComputeLinkDepends::InferDependencies()
void cmComputeLinkDepends::CleanConstraintGraph()
{
for (Graph::iterator i = this->EntryConstraintGraph.begin();
i != this->EntryConstraintGraph.end(); ++i) {
for (cmGraphEdgeList& edgeList : this->EntryConstraintGraph) {
// Sort the outgoing edges for each graph node so that the
// original order will be preserved as much as possible.
std::sort(i->begin(), i->end());
std::sort(edgeList.begin(), edgeList.end());
// Make the edge list unique.
i->erase(std::unique(i->begin(), i->end()), i->end());
edgeList.erase(std::unique(edgeList.begin(), edgeList.end()),
edgeList.end());
}
}
......@@ -660,9 +651,8 @@ void cmComputeLinkDepends::OrderLinkEntires()
}
// Start with the original link line.
for (std::vector<int>::const_iterator i = this->OriginalEntries.begin();
i != this->OriginalEntries.end(); ++i) {
this->VisitEntry(*i);
for (int originalEntry : this->OriginalEntries) {
this->VisitEntry(originalEntry);
}
// Now explore anything left pending. Since the component graph is
......@@ -684,13 +674,12 @@ void cmComputeLinkDepends::DisplayComponents()
for (unsigned int c = 0; c < components.size(); ++c) {