[Cmake-commits] CMake branch, next, updated. v3.1.0-1283-g8bda2ec

Stephen Kelly steveire at gmail.com
Fri Dec 19 11:36:36 EST 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  8bda2ecb6781d89957e2d4fb65d333bfa1530395 (commit)
       via  44f02a017d4a1f61488a9116cef24330ec1a10d9 (commit)
       via  e2a489c76aed54e96e85627a66692a11784e9824 (commit)
       via  0f99feec04193504a5a9ffc05e2132619ecf7dfe (commit)
       via  722f1a71e397d1ebfad439fcaae6e199c8976289 (commit)
      from  b73a2d2cdc48ca73c4ffa634500edba9d6be47f3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8bda2ecb6781d89957e2d4fb65d333bfa1530395
commit 8bda2ecb6781d89957e2d4fb65d333bfa1530395
Merge: b73a2d2 44f02a0
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Dec 19 11:36:34 2014 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Dec 19 11:36:34 2014 -0500

    Merge topic 'use-insert-with-iterators' into next
    
    44f02a01 Use insert instead of a loop in some cases.
    e2a489c7 Remove some temporary vectors for ExpandListArgument.
    0f99feec cmGeneratorExpression: Remove unused header.
    722f1a71 CTest: Expand a string directly into a container.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=44f02a017d4a1f61488a9116cef24330ec1a10d9
commit 44f02a017d4a1f61488a9116cef24330ec1a10d9
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Nov 22 11:00:45 2014 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Dec 19 00:06:00 2014 +0100

    Use insert instead of a loop in some cases.
    
    Limit this change to inserting into a vector from a vector.
    
    A follow up change can use insert for inserting into a set.

diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index d226a6c..5e7d764 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -1094,11 +1094,8 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, int length,
       {
       // Create a contiguous array for the line
       this->CurrentProcessingLine.clear();
-      t_BuildProcessingQueueType::iterator cit;
-      for ( cit = queue->begin(); cit != it; ++cit )
-        {
-        this->CurrentProcessingLine.push_back(*cit);
-        }
+      this->CurrentProcessingLine.insert(this->CurrentProcessingLine.end(),
+                                         queue->begin(), queue->end());
       this->CurrentProcessingLine.push_back(0);
       const char* line = &*this->CurrentProcessingLine.begin();
 
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index 4c89caa..97637ed 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -526,11 +526,8 @@ void cmCTestMultiProcessHandler::CreateParallelTestCostList()
 
     TestList sortedCopy;
 
-    for(TestSet::const_iterator j = currentSet.begin();
-      j != currentSet.end(); ++j)
-      {
-      sortedCopy.push_back(*j);
-      }
+    sortedCopy.insert(sortedCopy.end(),
+                      currentSet.begin(), currentSet.end());
 
     std::stable_sort(sortedCopy.begin(), sortedCopy.end(), comp);
 
diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx
index 0bb1a99..52b98d7 100644
--- a/Source/CTest/cmCTestP4.cxx
+++ b/Source/CTest/cmCTestP4.cxx
@@ -349,11 +349,7 @@ void cmCTestP4::SetP4Options(std::vector<char const*> &CommandOptions)
     std::vector<std::string> args =
             cmSystemTools::ParseArguments(opts.c_str());
 
-    for(std::vector<std::string>::const_iterator ai = args.begin();
-        ai != args.end(); ++ai)
-      {
-      P4Options.push_back(*ai);
-      }
+    P4Options.insert(P4Options.end(), args.begin(), args.end());
     }
 
   CommandOptions.clear();
diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx
index 07a994d..4aa8d04 100644
--- a/Source/CTest/cmCTestSubmitCommand.cxx
+++ b/Source/CTest/cmCTestSubmitCommand.cxx
@@ -74,13 +74,8 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
     std::vector<std::string> notesFiles;
     cmCTest::VectorOfStrings newNotesFiles;
     cmSystemTools::ExpandListArgument(notesFilesVariable,notesFiles);
-    std::vector<std::string>::iterator it;
-    for ( it = notesFiles.begin();
-      it != notesFiles.end();
-      ++ it )
-      {
-      newNotesFiles.push_back(*it);
-      }
+    newNotesFiles.insert(newNotesFiles.end(),
+                         notesFiles.begin(), notesFiles.end());
     this->CTest->GenerateNotesFile(newNotesFiles);
     }
 
@@ -91,13 +86,8 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
     std::vector<std::string> extraFiles;
     cmCTest::VectorOfStrings newExtraFiles;
     cmSystemTools::ExpandListArgument(extraFilesVariable,extraFiles);
-    std::vector<std::string>::iterator it;
-    for ( it = extraFiles.begin();
-      it != extraFiles.end();
-      ++ it )
-      {
-      newExtraFiles.push_back(*it);
-      }
+    newExtraFiles.insert(newExtraFiles.end(),
+                         extraFiles.begin(), extraFiles.end());
     if ( !this->CTest->SubmitExtraFiles(newExtraFiles))
       {
       this->SetError("problem submitting extra files.");
diff --git a/Source/cmAddTestCommand.cxx b/Source/cmAddTestCommand.cxx
index 2531a1a..dc3b4c2 100644
--- a/Source/cmAddTestCommand.cxx
+++ b/Source/cmAddTestCommand.cxx
@@ -36,11 +36,7 @@ bool cmAddTestCommand
 
   // Collect the command with arguments.
   std::vector<std::string> command;
-  for(std::vector<std::string>::const_iterator it = args.begin() + 1;
-      it != args.end(); ++it)
-    {
-    command.push_back(*it);
-    }
+  command.insert(command.end(), args.begin() + 1, args.end());
 
   // Create the test but add a generator only the first time it is
   // seen.  This preserves behavior from before test generators.
diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx
index aba26de..7a601e2 100644
--- a/Source/cmConditionEvaluator.cxx
+++ b/Source/cmConditionEvaluator.cxx
@@ -53,10 +53,7 @@ bool cmConditionEvaluator::IsTrue(
   cmArgumentList newArgs;
 
   // copy to the list structure
-  for(unsigned int i = 0; i < args.size(); ++i)
-    {
-    newArgs.push_back(args[i]);
-    }
+  newArgs.insert(newArgs.end(), args.begin(), args.end());
 
   // now loop through the arguments and see if we can reduce any of them
   // we do this multiple times. Once for each level of precedence
@@ -411,10 +408,7 @@ bool cmConditionEvaluator::HandleLevel0(cmArgumentList &newArgs,
         // copy to the list structure
         cmArgumentList::iterator argP1 = arg;
         argP1++;
-        for(; argP1 != argClose; argP1++)
-          {
-          newArgs2.push_back(*argP1);
-          }
+        newArgs2.insert(newArgs2.end(), argP1, argClose);
         newArgs2.pop_back();
         // now recursively invoke IsTrue to handle the values inside the
         // parenthetical expression
diff --git a/Source/cmCustomCommand.cxx b/Source/cmCustomCommand.cxx
index 2afb029..015825d 100644
--- a/Source/cmCustomCommand.cxx
+++ b/Source/cmCustomCommand.cxx
@@ -131,21 +131,14 @@ const char* cmCustomCommand::GetComment() const
 //----------------------------------------------------------------------------
 void cmCustomCommand::AppendCommands(const cmCustomCommandLines& commandLines)
 {
-  for(cmCustomCommandLines::const_iterator i=commandLines.begin();
-      i != commandLines.end(); ++i)
-    {
-    this->CommandLines.push_back(*i);
-    }
+  this->CommandLines.insert(this->CommandLines.end(),
+                            commandLines.begin(), commandLines.end());
 }
 
 //----------------------------------------------------------------------------
 void cmCustomCommand::AppendDepends(const std::vector<std::string>& depends)
 {
-  for(std::vector<std::string>::const_iterator i=depends.begin();
-      i != depends.end(); ++i)
-    {
-    this->Depends.push_back(*i);
-    }
+  this->Depends.insert(this->Depends.end(), depends.begin(), depends.end());
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index beb6dde..013724e 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -184,10 +184,8 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
     std::vector<std::string> shortArgs = this->Names;
     this->Names.clear(); // clear out any values in Names
     this->Names.push_back(shortArgs[0]);
-    for(unsigned int j = 1; j < shortArgs.size(); ++j)
-      {
-      this->UserGuessArgs.push_back(shortArgs[j]);
-      }
+    this->UserGuessArgs.insert(this->UserGuessArgs.end(),
+                               shortArgs.begin() + 1, shortArgs.end());
     }
   this->ExpandPaths();
 
diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx
index 3580374..488538f 100644
--- a/Source/cmFunctionCommand.cxx
+++ b/Source/cmFunctionCommand.cxx
@@ -271,11 +271,7 @@ bool cmFunctionCommand
 
   // create a function blocker
   cmFunctionFunctionBlocker *f = new cmFunctionFunctionBlocker();
-  for(std::vector<std::string>::const_iterator j = args.begin();
-      j != args.end(); ++j)
-    {
-    f->Args.push_back(*j);
-    }
+  f->Args.insert(f->Args.end(), args.begin(), args.end());
   this->Makefile->AddFunctionBlocker(f);
   return true;
 }
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 2b531e2..435452c 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -489,11 +489,7 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir,
       unique.insert(*li);
       }
     result.clear();
-    for(std::set<std::string>::iterator li = unique.begin();
-        li != unique.end(); ++li)
-      {
-      result.push_back(*li);
-      }
+    result.insert(result.end(), unique.begin(), unique.end());
 
     IncludeCacheType::value_type entry(config_upper, result);
     iter = this->SystemIncludesCache.insert(entry).first;
diff --git a/Source/cmInstallFilesCommand.cxx b/Source/cmInstallFilesCommand.cxx
index f106e1a..a007693 100644
--- a/Source/cmInstallFilesCommand.cxx
+++ b/Source/cmInstallFilesCommand.cxx
@@ -47,11 +47,8 @@ bool cmInstallFilesCommand
   else
     {
     this->IsFilesForm = false;
-    std::vector<std::string>::const_iterator s = args.begin();
-    for (++s;s != args.end(); ++s)
-      {
-      this->FinalArgs.push_back(*s);
-      }
+    this->FinalArgs.insert(this->FinalArgs.end(),
+                           args.begin() + 1, args.end());
     }
 
   this->Makefile->GetLocalGenerator()->GetGlobalGenerator()
diff --git a/Source/cmInstallProgramsCommand.cxx b/Source/cmInstallProgramsCommand.cxx
index 0405769..cc223ab 100644
--- a/Source/cmInstallProgramsCommand.cxx
+++ b/Source/cmInstallProgramsCommand.cxx
@@ -27,11 +27,7 @@ bool cmInstallProgramsCommand
 
   this->Destination = args[0];
 
-  std::vector<std::string>::const_iterator s = args.begin();
-  for (++s;s != args.end(); ++s)
-    {
-    this->FinalArgs.push_back(*s);
-    }
+  this->FinalArgs.insert(this->FinalArgs.end(), args.begin() + 1, args.end());
 
   this->Makefile->GetLocalGenerator()->GetGlobalGenerator()
                        ->AddInstallComponent(this->Makefile->GetSafeDefinition(
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 2de6c93..a4185ad 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -634,11 +634,7 @@ void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname,
     // Parse the string to get the custom command line.
     cmCustomCommandLine commandLine;
     std::vector<std::string> cmd = cmSystemTools::ParseArguments(i->c_str());
-    for(std::vector<std::string>::iterator a = cmd.begin();
-        a != cmd.end(); ++a)
-      {
-      commandLine.push_back(*a);
-      }
+    commandLine.insert(commandLine.end(), cmd.begin(), cmd.end());
 
     // Store this command line.
     commandLines.push_back(commandLine);
@@ -745,11 +741,7 @@ void cmLocalGenerator::AddBuildTargetRule(const std::string& llang,
     // Parse the string to get the custom command line.
     cmCustomCommandLine commandLine;
     std::vector<std::string> cmd = cmSystemTools::ParseArguments(i->c_str());
-    for(std::vector<std::string>::iterator a = cmd.begin();
-        a != cmd.end(); ++a)
-      {
-      commandLine.push_back(*a);
-      }
+    commandLine.insert(commandLine.end(), cmd.begin(), cmd.end());
 
     // Store this command line.
     commandLines.push_back(commandLine);
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 812ded3..96beb1c 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1856,13 +1856,8 @@ void cmLocalUnixMakefileGenerator3
         {
         text = "Running external command ...";
         }
-      std::set<std::string>::const_iterator dit;
-      for ( dit = glIt->second.GetUtilities().begin();
-         dit != glIt->second.GetUtilities().end();
-        ++ dit )
-        {
-        depends.push_back(*dit);
-        }
+      depends.insert(depends.end(), glIt->second.GetUtilities().begin(),
+                     glIt->second.GetUtilities().end());
       this->AppendEcho(commands, text,
                        cmLocalUnixMakefileGenerator3::EchoGlobal);
 
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index ae81c58..d399313 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -328,11 +328,7 @@ bool cmMacroCommand::InitialPass(std::vector<std::string> const& args,
 
   // create a function blocker
   cmMacroFunctionBlocker *f = new cmMacroFunctionBlocker();
-  for(std::vector<std::string>::const_iterator j = args.begin();
-      j != args.end(); ++j)
-    {
-    f->Args.push_back(*j);
-    }
+  f->Args.insert(f->Args.end(), args.begin(), args.end());
   this->Makefile->AddFunctionBlocker(f);
   return true;
 }
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 20dae5a..25d5881 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2567,12 +2567,7 @@ std::vector<std::string> cmMakefile
     }
 
   std::vector<std::string> res;
-
-  std::set<std::string>::iterator fit;
-  for ( fit = definitions.begin(); fit != definitions.end(); fit ++ )
-    {
-    res.push_back(*fit);
-    }
+  res.insert(res.end(), definitions.begin(), definitions.end());
   return res;
 }
 
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index cbf8573..040a7d6 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -759,13 +759,10 @@ cmMakefileTargetGenerator
   if(const char* extra_outputs_str =
      source.GetProperty("OBJECT_OUTPUTS"))
     {
+    // Register these as extra files to clean.
     cmSystemTools::ExpandListArgument(extra_outputs_str, outputs);
-    for(std::vector<std::string>::const_iterator eoi = outputs.begin()+1;
-        eoi != outputs.end(); ++eoi)
-      {
-      // Register this as an extra file to clean.
-      this->CleanFiles.push_back(*eoi);
-      }
+    this->CleanFiles.insert(this->CleanFiles.end(),
+                            outputs.begin() + 1, outputs.end());
     }
 
   // Write the rule.
@@ -1174,11 +1171,7 @@ cmMakefileTargetGenerator
       {
       cmCustomCommandGenerator ccg(*cc, this->ConfigName, this->Makefile);
       const std::vector<std::string>& outputs = ccg.GetOutputs();
-      for(std::vector<std::string>::const_iterator o = outputs.begin();
-          o != outputs.end(); ++o)
-        {
-        depends.push_back(*o);
-        }
+      depends.insert(depends.end(), outputs.begin(), outputs.end());
       }
     }
 }
@@ -1462,11 +1455,8 @@ void cmMakefileTargetGenerator::WriteTargetDriverRule(
       }
 
     // Make sure the extra files are built.
-    for(std::set<std::string>::const_iterator i = this->ExtraFiles.begin();
-        i != this->ExtraFiles.end(); ++i)
-      {
-      depends.push_back(*i);
-      }
+    depends.insert(depends.end(),
+                   this->ExtraFiles.begin(), this->ExtraFiles.end());
     }
 
   // Write the driver rule.
@@ -1553,11 +1543,7 @@ void cmMakefileTargetGenerator
   if(cmComputeLinkInformation* cli = this->Target->GetLinkInformation(cfg))
     {
     std::vector<std::string> const& libDeps = cli->GetDepends();
-    for(std::vector<std::string>::const_iterator j = libDeps.begin();
-        j != libDeps.end(); ++j)
-      {
-      depends.push_back(*j);
-      }
+    depends.insert(depends.end(), libDeps.begin(), libDeps.end());
     }
 }
 
@@ -1577,12 +1563,8 @@ void cmMakefileTargetGenerator
     }
 
   // Add dependencies on the external object files.
-  for(std::vector<std::string>::const_iterator obj
-        = this->ExternalObjects.begin();
-      obj != this->ExternalObjects.end(); ++obj)
-    {
-    depends.push_back(*obj);
-    }
+  depends.insert(depends.end(),
+                 this->ExternalObjects.begin(), this->ExternalObjects.end());
 
   // Add a dependency on the rule file itself.
   this->LocalGenerator->AppendRuleDepend(depends,
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index a01a384..443162a 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -2188,24 +2188,12 @@ bool cmQtAutoGenerators::GenerateMoc(const std::string& sourceFile,
 
     std::vector<std::string> command;
     command.push_back(this->MocExecutable);
-    for (std::list<std::string>::const_iterator it = this->MocIncludes.begin();
-         it != this->MocIncludes.end();
-         ++it)
-      {
-      command.push_back(*it);
-      }
-    for(std::list<std::string>::const_iterator it=this->MocDefinitions.begin();
-        it != this->MocDefinitions.end();
-        ++it)
-      {
-      command.push_back(*it);
-      }
-    for(std::vector<std::string>::const_iterator it=this->MocOptions.begin();
-        it != this->MocOptions.end();
-        ++it)
-      {
-      command.push_back(*it);
-      }
+    command.insert(command.end(),
+                   this->MocIncludes.begin(), this->MocIncludes.end());
+    command.insert(command.end(),
+                   this->MocDefinitions.begin(), this->MocDefinitions.end());
+    command.insert(command.end(),
+                   this->MocOptions.begin(), this->MocOptions.end());
 #ifdef _WIN32
     command.push_back("-DWIN32");
 #endif
@@ -2277,12 +2265,7 @@ bool cmQtAutoGenerators::GenerateUi(const std::string& realName,
       cmSystemTools::ExpandListArgument(optionIt->second, fileOpts);
       this->MergeUicOptions(opts, fileOpts, this->QtMajorVersion == "5");
       }
-    for(std::vector<std::string>::const_iterator optIt = opts.begin();
-        optIt != opts.end();
-        ++optIt)
-      {
-      command.push_back(*optIt);
-      }
+    command.insert(command.end(), opts.begin(), opts.end());
 
     command.push_back("-o");
     command.push_back(this->Builddir + ui_output_file);
diff --git a/Source/cmRemoveCommand.cxx b/Source/cmRemoveCommand.cxx
index bcb8564..d8aa1cb 100644
--- a/Source/cmRemoveCommand.cxx
+++ b/Source/cmRemoveCommand.cxx
@@ -39,10 +39,7 @@ bool cmRemoveCommand
   // check for REMOVE(VAR v1 v2 ... vn)
   std::vector<std::string> argsExpanded;
   std::vector<std::string> temp;
-  for(unsigned int j = 1; j < args.size(); ++j)
-    {
-    temp.push_back(args[j]);
-    }
+  temp.insert(temp.end(), args.begin() + 1, args.end());
   cmSystemTools::ExpandList(temp, argsExpanded);
 
   // now create the new value
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index c83dc2a..630944e 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1269,11 +1269,7 @@ bool cmSystemTools::Split(const char* s, std::vector<std::string>& l)
 {
   std::vector<std::string> temp;
   bool res = Superclass::Split(s, temp);
-  for(std::vector<std::string>::const_iterator i = temp.begin();
-      i != temp.end(); ++i)
-    {
-    l.push_back(*i);
-    }
+  l.insert(l.end(), temp.begin(), temp.end());
   return res;
 }
 
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 865a824..56e9258 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -6456,11 +6456,8 @@ cmTargetInternals::ComputeLinkImplementationLanguages(
   // Get languages used in our source files.
   thisTarget->GetLanguages(languages, config);
   // Copy the set of langauges to the link implementation.
-  for(std::set<std::string>::iterator li = languages.begin();
-      li != languages.end(); ++li)
-    {
-    impl.Languages.push_back(*li);
-    }
+  impl.Languages.insert(impl.Languages.begin(),
+                        languages.begin(), languages.end());
 }
 
 //----------------------------------------------------------------------------

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e2a489c76aed54e96e85627a66692a11784e9824
commit e2a489c76aed54e96e85627a66692a11784e9824
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Dec 18 21:03:38 2014 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Dec 19 00:06:00 2014 +0100

    Remove some temporary vectors for ExpandListArgument.
    
    Expand directly into the target when possible.

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<std::string> lval;
-            cmSystemTools::ExpandListArgument(val, lval);
-
-            for(std::vector<std::string>::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<std::string> lval;
-            cmSystemTools::ExpandListArgument(val, lval);
-
-            for(std::vector<std::string>::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<std::string> lval;
-            cmSystemTools::ExpandListArgument(val, lval);
-
-            for(std::vector<std::string>::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<std::string> lval;
-            cmSystemTools::ExpandListArgument(val, lval);
-            std::vector<std::string>::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<std::string> lval;
-            cmSystemTools::ExpandListArgument(val, lval);
-            std::vector<std::string>::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<std::string> lval;
-            cmSystemTools::ExpandListArgument(val, lval);
-            std::vector<std::string>::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<std::string> deps;
-    cmSystemTools::ExpandListArgument(objectDeps, deps);
-    for(std::vector<std::string>::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<std::string> opts;
-        cmSystemTools::ExpandListArgument(optionIt->second, opts);
-        for(std::vector<std::string>::const_iterator optIt = opts.begin();
-            optIt != opts.end();
-            ++optIt)
-          {
-          command.push_back(*optIt);
-          }
+        cmSystemTools::ExpandListArgument(optionIt->second, command);
         }
 
       command.push_back("-name");

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0f99feec04193504a5a9ffc05e2132619ecf7dfe
commit 0f99feec04193504a5a9ffc05e2132619ecf7dfe
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Dec 18 18:50:50 2014 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Dec 19 00:06:00 2014 +0100

    cmGeneratorExpression: Remove unused header.

diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index b6fe414..861122c 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -15,8 +15,6 @@
 #include "cmTarget.h"
 #include "assert.h"
 
-#include <cmsys/String.h>
-
 #include "cmGeneratorExpressionEvaluator.h"
 #include "cmGeneratorExpressionLexer.h"
 #include "cmGeneratorExpressionParser.h"

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=722f1a71e397d1ebfad439fcaae6e199c8976289
commit 722f1a71e397d1ebfad439fcaae6e199c8976289
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Dec 18 21:10:44 2014 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Dec 19 00:05:57 2014 +0100

    CTest: Expand a string directly into a container.
    
    Change the follow-up loop to use a const_iterator to log the
    content.

diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 2bf7b77..80dbaf3 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<std::string> slist;
-  cmSystemTools::ExpandListArgument(dval, slist);
-  std::vector<std::string>::iterator it;
 
   vec.clear();
+  cmSystemTools::ExpandListArgument(dval, vec);
 
-  for ( it = slist.begin(); it != slist.end(); ++it )
+  for (std::vector<std::string>::const_iterator it = vec.begin();
+       it != vec.end(); ++it )
     {
     cmCTestLog(this, DEBUG, "  -- " << *it << std::endl);
-    vec.push_back(*it);
     }
 }
 

-----------------------------------------------------------------------

Summary of changes:
 Source/CTest/cmCTestBuildHandler.cxx        |    7 ++--
 Source/CTest/cmCTestMultiProcessHandler.cxx |    7 ++--
 Source/CTest/cmCTestP4.cxx                  |    6 +---
 Source/CTest/cmCTestSubmitCommand.cxx       |   18 +++-------
 Source/CTest/cmCTestTestHandler.cxx         |   51 ++++-----------------------
 Source/cmAddTestCommand.cxx                 |    6 +---
 Source/cmCTest.cxx                          |    8 ++---
 Source/cmConditionEvaluator.cxx             |   10 ++----
 Source/cmCustomCommand.cxx                  |   13 ++-----
 Source/cmFindBase.cxx                       |    6 ++--
 Source/cmFunctionCommand.cxx                |    6 +---
 Source/cmGeneratorExpression.cxx            |    2 --
 Source/cmGeneratorTarget.cxx                |    6 +---
 Source/cmInstallFilesCommand.cxx            |    7 ++--
 Source/cmInstallProgramsCommand.cxx         |    6 +---
 Source/cmLocalGenerator.cxx                 |   12 ++-----
 Source/cmLocalUnixMakefileGenerator3.cxx    |    9 ++---
 Source/cmMacroCommand.cxx                   |    6 +---
 Source/cmMakefile.cxx                       |    7 +---
 Source/cmMakefileTargetGenerator.cxx        |   44 ++++++-----------------
 Source/cmQtAutoGenerators.cxx               |   40 +++++----------------
 Source/cmRemoveCommand.cxx                  |    5 +--
 Source/cmSystemTools.cxx                    |    6 +---
 Source/cmTarget.cxx                         |    7 ++--
 24 files changed, 59 insertions(+), 236 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list