From 314c9ae33bfd304c9622b89ec62bca052f6e0d39 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 2 Aug 2015 09:11:55 +0200 Subject: [PATCH] cmLocalGenerator: Make GetFeature tail-recursive. --- Source/cmLocalGenerator.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index edb644de7..169cdf46d 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2384,11 +2384,12 @@ const char* cmLocalGenerator::GetFeature(const std::string& feature, { return value; } - if(cmLocalGenerator* parent = this->GetParent()) + cmLocalGenerator* parent = this->GetParent(); + if(!parent) { - return parent->GetFeature(feature, config); + return 0; } - return 0; + return parent->GetFeature(feature, config); } //----------------------------------------------------------------------------