[Cmake-commits] CMake branch, next, updated. v3.1.2-1288-g1af2299

Stephen Kelly steveire at gmail.com
Wed Feb 11 16:26:12 EST 2015


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  1af2299bd96f8d75142af21439a81a4038608198 (commit)
       via  2ad4e4cdcc316de116baa2a8611476dec6b5e99a (commit)
      from  9e978e3ee89f5f53991cd09e1b25ba3d2ec03e98 (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=1af2299bd96f8d75142af21439a81a4038608198
commit 1af2299bd96f8d75142af21439a81a4038608198
Merge: 9e978e3 2ad4e4c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Feb 11 16:26:12 2015 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Feb 11 16:26:12 2015 -0500

    Merge topic 'clean-up-cmMacroCommand' into next
    
    2ad4e4cd cmMacroCommand: Manipulate target string directly.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2ad4e4cdcc316de116baa2a8611476dec6b5e99a
commit 2ad4e4cdcc316de116baa2a8611476dec6b5e99a
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Feb 11 22:16:03 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Feb 11 22:16:03 2015 +0100

    cmMacroCommand: Manipulate target string directly.
    
    Avoid copying a string from the source, manipulating it, and then
    copying it back.  Manipulate it in place instead.

diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index c6f0571..e2751f9 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -151,37 +151,33 @@ bool cmMacroHelperCommand::InvokeInitialPass
       k->FilePath = this->FilePath.c_str();
 
       cmListFileArgument arg;
-      if(k->Delim == cmListFileArgument::Bracket)
+      arg.Value = k->Value;
+      if(k->Delim != cmListFileArgument::Bracket)
         {
-        arg.Value = k->Value;
-        }
-      else
-        {
-        std::string tmps = k->Value;
         // replace formal arguments
         for (unsigned int j = 0; j < variables.size(); ++j)
           {
-          cmSystemTools::ReplaceString(tmps, variables[j].c_str(),
+          cmSystemTools::ReplaceString(arg.Value, variables[j].c_str(),
                                        expandedArgs[j].c_str());
           }
         // replace argc
-        cmSystemTools::ReplaceString(tmps, "${ARGC}",argcDef.c_str());
+        cmSystemTools::ReplaceString(arg.Value, "${ARGC}",argcDef.c_str());
 
-        cmSystemTools::ReplaceString(tmps, "${ARGN}", expandedArgn.c_str());
-        cmSystemTools::ReplaceString(tmps, "${ARGV}", expandedArgv.c_str());
+        cmSystemTools::ReplaceString(arg.Value, "${ARGN}",
+                                     expandedArgn.c_str());
+        cmSystemTools::ReplaceString(arg.Value, "${ARGV}",
+                                     expandedArgv.c_str());
 
         // if the current argument of the current function has ${ARGV in it
         // then try replacing ARGV values
-        if (tmps.find("${ARGV") != std::string::npos)
+        if (arg.Value.find("${ARGV") != std::string::npos)
           {
           for (unsigned int t = 0; t < expandedArgs.size(); ++t)
             {
-            cmSystemTools::ReplaceString(tmps, argVs[t].c_str(),
+            cmSystemTools::ReplaceString(arg.Value, argVs[t].c_str(),
                                          expandedArgs[t].c_str());
             }
           }
-
-        arg.Value = tmps;
         }
       arg.Delim = k->Delim;
       arg.FilePath = k->FilePath;

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

Summary of changes:
 Source/cmMacroCommand.cxx |   24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list