[Cmake-commits] CMake branch, next, updated. v3.2.2-2184-g0b12050

Stephen Kelly steveire at gmail.com
Sun Apr 26 15:44:00 EDT 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  0b1205035e42dd71987a3f663e8b1b1f3b93f1e3 (commit)
       via  2111933550c0baa41c67b9a21a073bbca56c4167 (commit)
      from  9e58d685db1ca130f61d6fffeb59e98e14bcc3b0 (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=0b1205035e42dd71987a3f663e8b1b1f3b93f1e3
commit 0b1205035e42dd71987a3f663e8b1b1f3b93f1e3
Merge: 9e58d68 2111933
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 26 15:43:59 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Apr 26 15:43:59 2015 -0400

    Merge topic 'refactor-cmDefinitions' into next
    
    21119335 cmMakefile: Simplify the implementation of GetDefintion.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2111933550c0baa41c67b9a21a073bbca56c4167
commit 2111933550c0baa41c67b9a21a073bbca56c4167
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 26 21:42:23 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Apr 26 21:42:23 2015 +0200

    cmMakefile: Simplify the implementation of GetDefintion.
    
    No need to create an intermediate vector anymore.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index c51984b..d169765 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -70,28 +70,21 @@ public:
 
   const char* GetDefinition(std::string const& name)
   {
-    std::vector<cmDefinitions*> defPtrs;
-    defPtrs.reserve(this->VarStack.size());
-    for (std::vector<cmDefinitions>::iterator it = this->VarStack.begin();
-        it != this->VarStack.end(); ++it)
-      {
-      defPtrs.push_back(&*it);
-      }
     std::pair<const char*, bool> result((const char*)0, false);
-    std::vector<cmDefinitions*>::reverse_iterator it = defPtrs.rbegin();
-    for ( ; it != defPtrs.rend(); ++it)
+    std::vector<cmDefinitions>::reverse_iterator it = this->VarStack.rbegin();
+    for ( ; it != this->VarStack.rend(); ++it)
       {
-      result = (*it)->Get(name);
+      result = it->Get(name);
       if(result.second)
         {
         break;
         }
       }
-    std::vector<cmDefinitions*>::reverse_iterator last = it;
+    std::vector<cmDefinitions>::reverse_iterator last = it;
     // Store the result in intermediate scopes.
-    for (it = defPtrs.rbegin(); it != last; ++it)
+    for (it = this->VarStack.rbegin(); it != last; ++it)
       {
-      (*it)->Set(name, result.first);
+      it->Set(name, result.first);
       }
     return result.first;
   }

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

Summary of changes:
 Source/cmMakefile.cxx |   19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list