summaryrefslogtreecommitdiff
path: root/Source/cmDefinitions.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-04-26 15:49:43 +0200
committerStephen Kelly <steveire@gmail.com>2015-04-29 22:51:46 +0200
commitf983d8913b3293f0f328811d243222c6e19c795e (patch)
tree8dd7836d21c4e92ca17f3f9c451b0b983ee5d8bc /Source/cmDefinitions.cxx
parent24885d4efa17d4232e266ef053899613c32fdeb7 (diff)
downloadcmake-f983d8913b3293f0f328811d243222c6e19c795e.tar.gz
cmDefinitions: Replace recursion with loop.
Diffstat (limited to 'Source/cmDefinitions.cxx')
-rw-r--r--Source/cmDefinitions.cxx34
1 files changed, 16 insertions, 18 deletions
diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index c4d285a732..2ee2618d01 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -87,29 +87,27 @@ cmDefinitions cmDefinitions::MakeClosure() const
void cmDefinitions::MakeClosure(std::set<std::string>& undefined,
cmDefinitions const* defs)
{
- // Consider local definitions.
- for(MapType::const_iterator mi = defs->Map.begin();
- mi != defs->Map.end(); ++mi)
+ while(defs)
{
- // Use this key if it is not already set or unset.
- if(this->Map.find(mi->first) == this->Map.end() &&
- undefined.find(mi->first) == undefined.end())
+ // Consider local definitions.
+ for(MapType::const_iterator mi = defs->Map.begin();
+ mi != defs->Map.end(); ++mi)
{
- if(mi->second.Exists)
- {
- this->Map.insert(*mi);
- }
- else
+ // Use this key if it is not already set or unset.
+ if(this->Map.find(mi->first) == this->Map.end() &&
+ undefined.find(mi->first) == undefined.end())
{
- undefined.insert(mi->first);
+ if(mi->second.Exists)
+ {
+ this->Map.insert(*mi);
+ }
+ else
+ {
+ undefined.insert(mi->first);
+ }
}
}
- }
-
- // Traverse parents.
- if(cmDefinitions const* up = defs->Up)
- {
- this->MakeClosure(undefined, up);
+ defs = defs->Up;
}
}