From fc1cf2654de04ed8f6954dc1907ab1dcb8bb946e Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 11 Feb 2015 23:31:22 +0100 Subject: [PATCH] cmFunctionCommand: Remove counting variable. Start iteration at correct starting point directly. --- Source/cmFunctionCommand.cxx | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index a0a14e82f..088a697b6 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -137,17 +137,13 @@ bool cmFunctionHelperCommand::InvokeInitialPass argvDef += *eit; } std::string argnDef; - unsigned int cnt = 0; - for ( eit = expandedArgs.begin(); eit != expandedArgs.end(); ++eit ) - if ( cnt >= this->Args.size()-1 ) + eit = expandedArgs.begin() + (this->Args.size()-1); + for ( ; eit != expandedArgs.end(); ++eit) + if (!argnDef.empty()) { - if (!argnDef.empty()) - { - argnDef += ";"; - } - argnDef += *eit; + argnDef += ";"; } - cnt ++; + argnDef += *eit; } this->Makefile->AddDefinition("ARGV", argvDef.c_str()); this->Makefile->MarkVariableAsUsed("ARGV");