summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-04-06 10:30:21 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-04-07 21:25:31 (GMT)
commit97c50a8dbd9f1ca5026f60e4a224e9a087e01f0e (patch)
tree55c829e7e7f475b44aa815228ad857fe28509688 /Source
parentd3823263b2665e5b89668212bc498af3220ac992 (diff)
downloadCMake-97c50a8dbd9f1ca5026f60e4a224e9a087e01f0e.zip
CMake-97c50a8dbd9f1ca5026f60e4a224e9a087e01f0e.tar.gz
CMake-97c50a8dbd9f1ca5026f60e4a224e9a087e01f0e.tar.bz2
cmMakefile: Simplify GetDefinitions implementation.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmMakefile.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 215ee16..7f44da2 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2501,20 +2501,20 @@ const char* cmMakefile::GetSafeDefinition(const std::string& def) const
std::vector<std::string> cmMakefile
::GetDefinitions(int cacheonly /* = 0 */) const
{
- std::set<std::string> definitions;
+ std::vector<std::string> res;
if ( !cacheonly )
{
- definitions = this->Internal->VarStack.top().ClosureKeys();
+ std::set<std::string> definitions =
+ this->Internal->VarStack.top().ClosureKeys();
+ res.insert(res.end(), definitions.begin(), definitions.end());
}
cmCacheManager::CacheIterator cit =
this->GetCacheManager()->GetCacheIterator();
for ( cit.Begin(); !cit.IsAtEnd(); cit.Next() )
{
- definitions.insert(cit.GetName());
+ res.push_back(cit.GetName());
}
-
- std::vector<std::string> res;
- res.insert(res.end(), definitions.begin(), definitions.end());
+ std::sort(res.begin(), res.end());
return res;
}