From 7441fde34abf5a3eab58917b8bf4acb89d72c00c Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 2 Aug 2015 09:16:17 +0200 Subject: [PATCH] cmLocalGenerator: Convert GetFeature recursion to loop. --- Source/cmLocalGenerator.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 2a88e3c83d..8e12eb6d0d 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2376,16 +2376,16 @@ const char* cmLocalGenerator::GetFeature(const std::string& feature, featureName += "_"; featureName += cmSystemTools::UpperCase(config); } - if(const char* value = this->Makefile->GetProperty(featureName)) + cmLocalGenerator* lg = this; + while(lg) { - return value; + if(const char* value = lg->GetMakefile()->GetProperty(featureName)) + { + return value; + } + lg = lg->GetParent(); } - cmLocalGenerator* parent = this->GetParent(); - if(!parent) - { - return 0; - } - return parent->GetFeature(feature, config); + return 0; } //----------------------------------------------------------------------------