From 722f1a71e397d1ebfad439fcaae6e199c8976289 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 18 Dec 2014 21:10:44 +0100 Subject: [PATCH] CTest: Expand a string directly into a container. Change the follow-up loop to use a const_iterator to log the content. --- Source/cmCTest.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 2bf7b77e7..80dbaf30a 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -2598,16 +2598,14 @@ void cmCTest::PopulateCustomVector(cmMakefile* mf, const std::string& def, return; } cmCTestLog(this, DEBUG, "PopulateCustomVector: " << def << std::endl); - std::vector slist; - cmSystemTools::ExpandListArgument(dval, slist); - std::vector::iterator it; vec.clear(); + cmSystemTools::ExpandListArgument(dval, vec); - for ( it = slist.begin(); it != slist.end(); ++it ) + for (std::vector::const_iterator it = vec.begin(); + it != vec.end(); ++it ) { cmCTestLog(this, DEBUG, " -- " << *it << std::endl); - vec.push_back(*it); } }