Просмотр исходного кода

cmGeneratorExpressionEvaluator: Replace own algorithm with cmDeleteAll.

Stephen Kelly 10 лет назад
Родитель
Сommit
30d2de9aa8
1 измененных файлов с 3 добавлено и 24 удалено
  1. 3 24
      Source/cmGeneratorExpressionEvaluator.cxx

+ 3 - 24
Source/cmGeneratorExpressionEvaluator.cxx

@@ -2044,31 +2044,10 @@ std::string GeneratorExpressionContent::EvaluateParameters(
   return std::string();
 }
 
-//----------------------------------------------------------------------------
-static void deleteAll(const std::vector<cmGeneratorExpressionEvaluator*> &c)
-{
-  std::vector<cmGeneratorExpressionEvaluator*>::const_iterator it
-                                                  = c.begin();
-  const std::vector<cmGeneratorExpressionEvaluator*>::const_iterator end
-                                                  = c.end();
-  for ( ; it != end; ++it)
-    {
-    delete *it;
-    }
-}
-
 //----------------------------------------------------------------------------
 GeneratorExpressionContent::~GeneratorExpressionContent()
 {
-  deleteAll(this->IdentifierChildren);
-
-  typedef std::vector<cmGeneratorExpressionEvaluator*> EvaluatorVector;
-  std::vector<EvaluatorVector>::const_iterator pit =
-                                                  this->ParamChildren.begin();
-  const std::vector<EvaluatorVector>::const_iterator pend =
-                                                  this->ParamChildren.end();
-  for ( ; pit != pend; ++pit)
-    {
-    deleteAll(*pit);
-    }
+  cmDeleteAll(this->IdentifierChildren);
+  std::for_each(this->ParamChildren.begin(), this->ParamChildren.end(),
+                cmDeleteAll<std::vector<cmGeneratorExpressionEvaluator*> >);
 }