[Cmake-commits] CMake branch, next, updated. v3.2.2-2283-gd5680b6
Brad King
brad.king at kitware.com
Wed Apr 29 11:05:53 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 d5680b6aeb784ad02a529248588d85a538dd4b14 (commit)
via eb0d523f4cbdbb3dca6b39ca6df3570d0e40c499 (commit)
from 6e1ee21ec4a0078c1701379011970e048e3d67f7 (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=d5680b6aeb784ad02a529248588d85a538dd4b14
commit d5680b6aeb784ad02a529248588d85a538dd4b14
Merge: 6e1ee21 eb0d523
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Apr 29 11:05:53 2015 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Apr 29 11:05:53 2015 -0400
Merge topic 'refactor-cmDefinitions-API' into next
eb0d523f cmDefinitions: Simplify ClosureKeys logic
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eb0d523f4cbdbb3dca6b39ca6df3570d0e40c499
commit eb0d523f4cbdbb3dca6b39ca6df3570d0e40c499
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Apr 29 11:04:04 2015 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Wed Apr 29 11:04:04 2015 -0400
cmDefinitions: Simplify ClosureKeys logic
Construct the final list directly in a named return value. Use
a single set to track bindings already found.
diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index 0556654..976710e 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -123,8 +123,8 @@ void cmDefinitions::ClosureImpl(std::set<std::string>& undefined,
//----------------------------------------------------------------------------
std::vector<std::string> cmDefinitions::ClosureKeys() const
{
- std::set<std::string> defined;
- std::set<std::string> undefined;
+ std::vector<std::string> defined;
+ std::set<std::string> bound;
cmDefinitions const* up = this;
@@ -135,14 +135,12 @@ std::vector<std::string> cmDefinitions::ClosureKeys() const
mi != up->Map.end(); ++mi)
{
// Use this key if it is not already set or unset.
- if(defined.find(mi->first) == defined.end() &&
- undefined.find(mi->first) == undefined.end())
+ if(bound.insert(mi->first).second && mi->second.Exists)
{
- std::set<std::string>& m = mi->second.Exists? defined : undefined;
- m.insert(mi->first);
+ defined.push_back(mi->first);
}
}
up = up->Up;
}
- return std::vector<std::string>(defined.begin(), defined.end());
+ return defined;
}
-----------------------------------------------------------------------
Summary of changes:
Source/cmDefinitions.cxx | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list