cmDefinitions: Replace recursion with loop.
This commit is contained in:
parent
24885d4efa
commit
f983d8913b
|
@ -87,29 +87,27 @@ cmDefinitions cmDefinitions::MakeClosure() const
|
||||||
void cmDefinitions::MakeClosure(std::set<std::string>& undefined,
|
void cmDefinitions::MakeClosure(std::set<std::string>& undefined,
|
||||||
cmDefinitions const* defs)
|
cmDefinitions const* defs)
|
||||||
{
|
{
|
||||||
// Consider local definitions.
|
while(defs)
|
||||||
for(MapType::const_iterator mi = defs->Map.begin();
|
|
||||||
mi != defs->Map.end(); ++mi)
|
|
||||||
{
|
{
|
||||||
// Use this key if it is not already set or unset.
|
// Consider local definitions.
|
||||||
if(this->Map.find(mi->first) == this->Map.end() &&
|
for(MapType::const_iterator mi = defs->Map.begin();
|
||||||
undefined.find(mi->first) == undefined.end())
|
mi != defs->Map.end(); ++mi)
|
||||||
{
|
{
|
||||||
if(mi->second.Exists)
|
// Use this key if it is not already set or unset.
|
||||||
|
if(this->Map.find(mi->first) == this->Map.end() &&
|
||||||
|
undefined.find(mi->first) == undefined.end())
|
||||||
{
|
{
|
||||||
this->Map.insert(*mi);
|
if(mi->second.Exists)
|
||||||
}
|
{
|
||||||
else
|
this->Map.insert(*mi);
|
||||||
{
|
}
|
||||||
undefined.insert(mi->first);
|
else
|
||||||
|
{
|
||||||
|
undefined.insert(mi->first);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
defs = defs->Up;
|
||||||
|
|
||||||
// Traverse parents.
|
|
||||||
if(cmDefinitions const* up = defs->Up)
|
|
||||||
{
|
|
||||||
this->MakeClosure(undefined, up);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue