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  902208172455e347099199f0382fb230bbdb593a (commit)
       via  dc03499595086ec190d55c59c8589c112362dbb6 (commit)
      from  c0436698786f2c196ed2849a6904d269b51db5f9 (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=902208172455e347099199f0382fb230bbdb593a
commit 902208172455e347099199f0382fb230bbdb593a
Merge: c043669 dc03499
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Fri Jun 14 08:52:50 2013 -0400
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Fri Jun 14 08:52:50 2013 -0400

    Merge topic 'remove_extra_matches' into next
    
    dc03499 Do not set CMAKE_MATCH_ variables when not neeeded


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dc03499595086ec190d55c59c8589c112362dbb6
commit dc03499595086ec190d55c59c8589c112362dbb6
Author:     Bill Hoffman <bill.hoff...@kitware.com>
AuthorDate: Thu Jun 6 12:50:20 2013 -0400
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Fri Jun 14 08:46:14 2013 -0400

    Do not set CMAKE_MATCH_ variables when not neeeded
    
    Each call to AddDefinition has overhead for variable watches and such.
    Avoid extra calls when not needed.
    
    This decreases the configure time for ParaView by 10 seconds on my
    machine.  Without the change about 1,000,000 set-to-empty calls were
    being made.  After the change it drops to about 100,000.

diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx
index 1fbde01..68ba13f 100644
--- a/Source/cmStringCommand.cxx
+++ b/Source/cmStringCommand.cxx
@@ -534,8 +534,12 @@ void cmStringCommand::ClearMatches(cmMakefile* mf)
     {
     char name[128];
     sprintf(name, "CMAKE_MATCH_%d", i);
-    mf->AddDefinition(name, "");
-    mf->MarkVariableAsUsed(name);
+    const char* s = mf->GetDefinition(name);
+    if(s && *s != 0)
+      {
+      mf->AddDefinition(name, "");
+      mf->MarkVariableAsUsed(name);
+      }
     }
 }
 
@@ -544,10 +548,14 @@ void cmStringCommand::StoreMatches(cmMakefile* 
mf,cmsys::RegularExpression& re)
 {
   for (unsigned int i=0; i<10; i++)
     {
-    char name[128];
-    sprintf(name, "CMAKE_MATCH_%d", i);
-    mf->AddDefinition(name, re.match(i).c_str());
-    mf->MarkVariableAsUsed(name);
+    std::string m = re.match(i);
+    if(m.size() > 0)
+      {
+      char name[128];
+      sprintf(name, "CMAKE_MATCH_%d", i);
+      mf->AddDefinition(name, re.match(i).c_str());
+      mf->MarkVariableAsUsed(name);
+      }
     }
 }
 

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

Summary of changes:


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits

Reply via email to