From 67a26764b536992a966cacab4811c2d30624405c Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 15 Feb 2015 18:02:56 +0100 Subject: cmListCommand: Implement REVERSE subcommand with std::reverse. --- Source/cmListCommand.cxx | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index ae13fdf..22d8b0e 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -410,15 +410,8 @@ bool cmListCommand return false; } - std::string value; - std::vector::reverse_iterator it; - const char* sep = ""; - for ( it = varArgsExpanded.rbegin(); it != varArgsExpanded.rend(); ++ it ) - { - value += sep; - value += it->c_str(); - sep = ";"; - } + std::reverse(varArgsExpanded.begin(), varArgsExpanded.end()); + std::string value = cmJoin(varArgsExpanded, ";"); this->Makefile->AddDefinition(listName, value.c_str()); return true; -- cgit v0.12