cmDefinitions: Make the ClosureKeys method static.
For consistency with all other closure-related methods.
This commit is contained in:
parent
98c5c90361
commit
f170985e7a
|
@ -105,12 +105,16 @@ cmDefinitions cmDefinitions::MakeClosure(StackConstIter begin,
|
|||
|
||||
//----------------------------------------------------------------------------
|
||||
std::vector<std::string>
|
||||
cmDefinitions::ClosureKeys(std::set<std::string>& bound) const
|
||||
cmDefinitions::ClosureKeys(StackConstIter begin, StackConstIter end)
|
||||
{
|
||||
std::set<std::string> bound;
|
||||
std::vector<std::string> defined;
|
||||
defined.reserve(this->Map.size());
|
||||
for(MapType::const_iterator mi = this->Map.begin();
|
||||
mi != this->Map.end(); ++mi)
|
||||
|
||||
for (StackConstIter it = begin; it != end; ++it)
|
||||
{
|
||||
defined.reserve(defined.size() + it->Map.size());
|
||||
for(MapType::const_iterator mi = it->Map.begin();
|
||||
mi != it->Map.end(); ++mi)
|
||||
{
|
||||
// Use this key if it is not already set or unset.
|
||||
if(bound.insert(mi->first).second && mi->second.Exists)
|
||||
|
@ -118,5 +122,7 @@ cmDefinitions::ClosureKeys(std::set<std::string>& bound) const
|
|||
defined.push_back(mi->first);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return defined;
|
||||
}
|
||||
|
|
|
@ -44,8 +44,8 @@ public:
|
|||
/** Get the set of all local keys. */
|
||||
std::vector<std::string> LocalKeys() const;
|
||||
|
||||
std::vector<std::string>
|
||||
ClosureKeys(std::set<std::string>& bound) const;
|
||||
static std::vector<std::string> ClosureKeys(StackConstIter begin,
|
||||
StackConstIter end);
|
||||
|
||||
static cmDefinitions MakeClosure(StackConstIter begin, StackConstIter end);
|
||||
|
||||
|
|
|
@ -94,16 +94,8 @@ public:
|
|||
|
||||
std::vector<std::string> ClosureKeys() const
|
||||
{
|
||||
std::vector<std::string> closureKeys;
|
||||
std::set<std::string> bound;
|
||||
for (std::list<cmDefinitions>::const_reverse_iterator it =
|
||||
this->VarStack.rbegin(); it != this->VarStack.rend(); ++it)
|
||||
{
|
||||
std::vector<std::string> const& localKeys = it->ClosureKeys(bound);
|
||||
closureKeys.insert(closureKeys.end(),
|
||||
localKeys.begin(), localKeys.end());
|
||||
}
|
||||
return closureKeys;
|
||||
return cmDefinitions::ClosureKeys(this->VarStack.rbegin(),
|
||||
this->VarStack.rend());
|
||||
}
|
||||
|
||||
void PopDefinitions()
|
||||
|
|
Loading…
Reference in New Issue