Explorar el Código

cmLocalGenerator: Make GetFeature tail-recursive.

Stephen Kelly hace 10 años
padre
commit
314c9ae33b
Se han modificado 1 ficheros con 4 adiciones y 3 borrados
  1. 4 3
      Source/cmLocalGenerator.cxx

+ 4 - 3
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);
 }
 
 //----------------------------------------------------------------------------