cmDefinitions: Replace ClosureKeys recursion with looping.
This commit is contained in:
parent
818bf727c1
commit
78e1454ea0
|
@ -131,9 +131,13 @@ std::set<std::string> cmDefinitions::ClosureKeys() const
|
||||||
void cmDefinitions::ClosureKeys(std::set<std::string>& defined,
|
void cmDefinitions::ClosureKeys(std::set<std::string>& defined,
|
||||||
std::set<std::string>& undefined) const
|
std::set<std::string>& undefined) const
|
||||||
{
|
{
|
||||||
|
cmDefinitions const* up = this;
|
||||||
|
|
||||||
|
while (up)
|
||||||
|
{
|
||||||
// Consider local definitions.
|
// Consider local definitions.
|
||||||
for(MapType::const_iterator mi = this->Map.begin();
|
for(MapType::const_iterator mi = up->Map.begin();
|
||||||
mi != this->Map.end(); ++mi)
|
mi != up->Map.end(); ++mi)
|
||||||
{
|
{
|
||||||
// Use this key if it is not already set or unset.
|
// Use this key if it is not already set or unset.
|
||||||
if(defined.find(mi->first) == defined.end() &&
|
if(defined.find(mi->first) == defined.end() &&
|
||||||
|
@ -143,10 +147,6 @@ void cmDefinitions::ClosureKeys(std::set<std::string>& defined,
|
||||||
m.insert(mi->first);
|
m.insert(mi->first);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
up = up->Up;
|
||||||
// Traverse parents.
|
|
||||||
if(cmDefinitions const* up = this->Up)
|
|
||||||
{
|
|
||||||
up->ClosureKeys(defined, undefined);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue