diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-06-04 21:38:51 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-07-25 12:48:36 (GMT) |
commit | 84e18056668491d5a7e0068c9287455151a18197 (patch) | |
tree | 613c013de33b7102649cff4974beedd28f80d7fd /Source/cmMakefile.cxx | |
parent | e00e8713de13570b8ca41291c0a863a8be00686c (diff) | |
download | CMake-84e18056668491d5a7e0068c9287455151a18197.zip CMake-84e18056668491d5a7e0068c9287455151a18197.tar.gz CMake-84e18056668491d5a7e0068c9287455151a18197.tar.bz2 |
cmMakefile: Convert recursion to loop.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index ae69b24..36b42bd 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4770,21 +4770,19 @@ cmMakefile::GetPolicyStatus(cmPolicies::PolicyID id) const cmPolicies::PolicyStatus cmMakefile::GetPolicyStatusInternal(cmPolicies::PolicyID id) const { - // Is the policy set in our stack? - for(PolicyStackType::const_reverse_iterator psi = this->PolicyStack.rbegin(); - psi != this->PolicyStack.rend(); ++psi) + cmLocalGenerator* lg = this->LocalGenerator; + while(lg) { - if(psi->IsDefined(id)) + cmMakefile const* mf = lg->GetMakefile(); + for(PolicyStackType::const_reverse_iterator psi = + mf->PolicyStack.rbegin(); psi != mf->PolicyStack.rend(); ++psi) { - return psi->Get(id); + if(psi->IsDefined(id)) + { + return psi->Get(id); + } } - } - - // If we have a parent directory, recurse up to it. - if(this->LocalGenerator->GetParent()) - { - cmMakefile* parent = this->LocalGenerator->GetParent()->GetMakefile(); - return parent->GetPolicyStatusInternal(id); + lg = lg->GetParent(); } // The policy is not set. Use the default for this CMake version. |