From e2a489c76aed54e96e85627a66692a11784e9824 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 18 Dec 2014 21:03:38 +0100 Subject: Remove some temporary vectors for ExpandListArgument. Expand directly into the target when possible. --- Source/CTest/cmCTestTestHandler.cxx | 51 +++++------------------------------- Source/cmMakefileTargetGenerator.cxx | 8 +----- Source/cmQtAutoGenerators.cxx | 9 +------ 3 files changed, 8 insertions(+), 60 deletions(-) diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index f330e58..78f1fd4 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -2153,25 +2153,11 @@ bool cmCTestTestHandler::SetTestsProperties( } if ( key == "ATTACHED_FILES" ) { - std::vector lval; - cmSystemTools::ExpandListArgument(val, lval); - - for(std::vector::iterator f = lval.begin(); - f != lval.end(); ++f) - { - rtit->AttachedFiles.push_back(*f); - } + cmSystemTools::ExpandListArgument(val, rtit->AttachedFiles); } if ( key == "ATTACHED_FILES_ON_FAIL" ) { - std::vector lval; - cmSystemTools::ExpandListArgument(val, lval); - - for(std::vector::iterator f = lval.begin(); - f != lval.end(); ++f) - { - rtit->AttachOnFail.push_back(*f); - } + cmSystemTools::ExpandListArgument(val, rtit->AttachOnFail); } if ( key == "RESOURCE_LOCK" ) { @@ -2195,14 +2181,7 @@ bool cmCTestTestHandler::SetTestsProperties( } if ( key == "REQUIRED_FILES" ) { - std::vector lval; - cmSystemTools::ExpandListArgument(val, lval); - - for(std::vector::iterator f = lval.begin(); - f != lval.end(); ++f) - { - rtit->RequiredFiles.push_back(*f); - } + cmSystemTools::ExpandListArgument(val, rtit->RequiredFiles); } if ( key == "RUN_SERIAL" ) { @@ -2239,33 +2218,15 @@ bool cmCTestTestHandler::SetTestsProperties( } if ( key == "DEPENDS" ) { - std::vector lval; - cmSystemTools::ExpandListArgument(val, lval); - std::vector::iterator crit; - for ( crit = lval.begin(); crit != lval.end(); ++ crit ) - { - rtit->Depends.push_back(*crit); - } + cmSystemTools::ExpandListArgument(val, rtit->Depends); } if ( key == "ENVIRONMENT" ) { - std::vector lval; - cmSystemTools::ExpandListArgument(val, lval); - std::vector::iterator crit; - for ( crit = lval.begin(); crit != lval.end(); ++ crit ) - { - rtit->Environment.push_back(*crit); - } + cmSystemTools::ExpandListArgument(val, rtit->Environment); } if ( key == "LABELS" ) { - std::vector lval; - cmSystemTools::ExpandListArgument(val, lval); - std::vector::iterator crit; - for ( crit = lval.begin(); crit != lval.end(); ++ crit ) - { - rtit->Labels.push_back(*crit); - } + cmSystemTools::ExpandListArgument(val, rtit->Labels); } if ( key == "MEASUREMENT" ) { diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 067714e..cbf8573 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -1193,13 +1193,7 @@ void cmMakefileTargetGenerator depends.push_back(source.GetFullPath()); if(const char* objectDeps = source.GetProperty("OBJECT_DEPENDS")) { - std::vector deps; - cmSystemTools::ExpandListArgument(objectDeps, deps); - for(std::vector::iterator i = deps.begin(); - i != deps.end(); ++i) - { - depends.push_back(*i); - } + cmSystemTools::ExpandListArgument(objectDeps, depends); } } diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 0c38366..a01a384 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -2368,14 +2368,7 @@ bool cmQtAutoGenerators::GenerateQrc() = this->RccOptions.find(*si); if (optionIt != this->RccOptions.end()) { - std::vector opts; - cmSystemTools::ExpandListArgument(optionIt->second, opts); - for(std::vector::const_iterator optIt = opts.begin(); - optIt != opts.end(); - ++optIt) - { - command.push_back(*optIt); - } + cmSystemTools::ExpandListArgument(optionIt->second, command); } command.push_back("-name"); -- cgit v0.12