summaryrefslogtreecommitdiffstats
path: root/Source/cmMacroCommand.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-01-25 14:44:49 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-02-11 19:51:06 (GMT)
commit11ecc31d0a2da0090195a682364fb4628f55673a (patch)
treebe2a2068552632f25cb741a9814f5c57bf57f43c /Source/cmMacroCommand.cxx
parentf95543f8a6b38bf6d5350169bdb53d5066839b76 (diff)
downloadCMake-11ecc31d0a2da0090195a682364fb4628f55673a.zip
CMake-11ecc31d0a2da0090195a682364fb4628f55673a.tar.gz
CMake-11ecc31d0a2da0090195a682364fb4628f55673a.tar.bz2
cmMacroCommand: Execute loop only if it has an effect.
Diffstat (limited to 'Source/cmMacroCommand.cxx')
-rw-r--r--Source/cmMacroCommand.cxx21
1 files changed, 12 insertions, 9 deletions
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index c1eb35e..c1e7cbb 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -164,20 +164,23 @@ bool cmMacroHelperCommand::InvokeInitialPass
{
if (!argnDefInitialized)
{
- std::vector<std::string>::const_iterator eit
- = expandedArgs.begin();
- std::vector<std::string>::size_type cnt = 0;
- for( ; eit != expandedArgs.end(); ++eit)
+ if (expandedArgs.size() > this->Args.size() - 1)
{
- if ( cnt >= this->Args.size()-1 )
+ std::vector<std::string>::const_iterator eit
+ = expandedArgs.begin();
+ std::vector<std::string>::size_type cnt = 0;
+ for( ; eit != expandedArgs.end(); ++eit)
{
- if (!argnDef.empty())
+ if ( cnt >= this->Args.size()-1 )
{
- argnDef += ";";
+ if (!argnDef.empty())
+ {
+ argnDef += ";";
+ }
+ argnDef += *eit;
}
- argnDef += *eit;
+ cnt ++;
}
- cnt ++;
}
argnDefInitialized = true;
}