summaryrefslogtreecommitdiffstats
path: root/Source/cmDefinitions.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmDefinitions.cxx')
-rw-r--r--Source/cmDefinitions.cxx28
1 files changed, 14 insertions, 14 deletions
diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index 448ba9d..a6f46e2 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -131,22 +131,22 @@ std::set<std::string> cmDefinitions::ClosureKeys() const
void cmDefinitions::ClosureKeys(std::set<std::string>& defined,
std::set<std::string>& undefined) const
{
- // Consider local definitions.
- for(MapType::const_iterator mi = this->Map.begin();
- mi != this->Map.end(); ++mi)
+ cmDefinitions const* up = this;
+
+ while (up)
{
- // Use this key if it is not already set or unset.
- if(defined.find(mi->first) == defined.end() &&
- undefined.find(mi->first) == undefined.end())
+ // Consider local definitions.
+ for(MapType::const_iterator mi = up->Map.begin();
+ mi != up->Map.end(); ++mi)
{
- std::set<std::string>& m = mi->second.Exists? defined : undefined;
- m.insert(mi->first);
+ // Use this key if it is not already set or unset.
+ if(defined.find(mi->first) == defined.end() &&
+ undefined.find(mi->first) == undefined.end())
+ {
+ std::set<std::string>& m = mi->second.Exists? defined : undefined;
+ m.insert(mi->first);
+ }
}
- }
-
- // Traverse parents.
- if(cmDefinitions const* up = this->Up)
- {
- up->ClosureKeys(defined, undefined);
+ up = up->Up;
}
}