cmDefinitions: Replace recursion with loop.

This commit is contained in:
Stephen Kelly 2015-04-26 15:49:43 +02:00
parent 24885d4efa
commit f983d8913b
1 changed files with 16 additions and 18 deletions

View File

@ -87,6 +87,8 @@ cmDefinitions cmDefinitions::MakeClosure() const
void cmDefinitions::MakeClosure(std::set<std::string>& undefined,
cmDefinitions const* defs)
{
while(defs)
{
// Consider local definitions.
for(MapType::const_iterator mi = defs->Map.begin();
mi != defs->Map.end(); ++mi)
@ -105,11 +107,7 @@ void cmDefinitions::MakeClosure(std::set<std::string>& undefined,
}
}
}
// Traverse parents.
if(cmDefinitions const* up = defs->Up)
{
this->MakeClosure(undefined, up);
defs = defs->Up;
}
}