From 30d2de9aa82196a12f47930e736181c48c568585 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 4 Jan 2015 16:35:26 +0100 Subject: cmGeneratorExpressionEvaluator: Replace own algorithm with cmDeleteAll. --- Source/cmGeneratorExpressionEvaluator.cxx | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 2f17915..22b61ba 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -2045,30 +2045,9 @@ std::string GeneratorExpressionContent::EvaluateParameters( } //---------------------------------------------------------------------------- -static void deleteAll(const std::vector &c) -{ - std::vector::const_iterator it - = c.begin(); - const std::vector::const_iterator end - = c.end(); - for ( ; it != end; ++it) - { - delete *it; - } -} - -//---------------------------------------------------------------------------- GeneratorExpressionContent::~GeneratorExpressionContent() { - deleteAll(this->IdentifierChildren); - - typedef std::vector EvaluatorVector; - std::vector::const_iterator pit = - this->ParamChildren.begin(); - const std::vector::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 >); } -- cgit v0.12