cmDefinitions: Remove internal MakeClosure method.

There is no need to have a separate method, or to pass an external
set to it.
This commit is contained in:
Stephen Kelly 2015-05-16 05:33:19 +02:00
parent fa85829712
commit 7872201bf6
2 changed files with 4 additions and 16 deletions

View File

@ -81,18 +81,8 @@ cmDefinitions cmDefinitions::MakeClosure(
std::list<cmDefinitions>::const_reverse_iterator rbegin,
std::list<cmDefinitions>::const_reverse_iterator rend)
{
std::set<std::string> undefined;
cmDefinitions closure;
closure.MakeClosure(undefined, rbegin, rend);
return closure;
}
//----------------------------------------------------------------------------
void
cmDefinitions::MakeClosure(std::set<std::string>& undefined,
std::list<cmDefinitions>::const_reverse_iterator rbegin,
std::list<cmDefinitions>::const_reverse_iterator rend)
{
std::set<std::string> undefined;
for (std::list<cmDefinitions>::const_reverse_iterator it = rbegin;
it != rend; ++it)
{
@ -101,12 +91,12 @@ cmDefinitions::MakeClosure(std::set<std::string>& undefined,
mi != it->Map.end(); ++mi)
{
// Use this key if it is not already set or unset.
if(this->Map.find(mi->first) == this->Map.end() &&
if(closure.Map.find(mi->first) == closure.Map.end() &&
undefined.find(mi->first) == undefined.end())
{
if(mi->second.Exists)
{
this->Map.insert(*mi);
closure.Map.insert(*mi);
}
else
{
@ -115,6 +105,7 @@ cmDefinitions::MakeClosure(std::set<std::string>& undefined,
}
}
}
return closure;
}
//----------------------------------------------------------------------------

View File

@ -76,9 +76,6 @@ private:
static Def const& GetInternal(const std::string& key,
std::list<cmDefinitions>::reverse_iterator rbegin,
std::list<cmDefinitions>::reverse_iterator rend);
void MakeClosure(std::set<std::string>& undefined,
std::list<cmDefinitions>::const_reverse_iterator rbegin,
std::list<cmDefinitions>::const_reverse_iterator rend);
};
#endif