diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-04-05 08:48:04 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-04-06 15:58:55 (GMT) |
commit | 9410e24a4ad3a21b2c27d057798f723e88d14d45 (patch) | |
tree | 9259e248faee43f15b544e1fa7ee61f3ce23e0c4 /Source/cmMakefile.cxx | |
parent | 7b7ae3b1a1d1c664eeef48392759883aa4040657 (diff) | |
download | CMake-9410e24a4ad3a21b2c27d057798f723e88d14d45.zip CMake-9410e24a4ad3a21b2c27d057798f723e88d14d45.tar.gz CMake-9410e24a4ad3a21b2c27d057798f723e88d14d45.tar.bz2 |
cmCacheManager: Port consumers to non-iterator API.
This simplifies reasoning about the follow-up commit which ports
away from cmCacheManager to a class with the same method names.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 7c1b9c4..34b4621 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1848,8 +1848,8 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, } } - this->GetCacheManager()->AddCacheEntry(name, haveVal ? val.c_str() : 0, doc, - type); + this->GetCacheManager()->AddCacheEntry(name, haveVal ? val.c_str() : 0, + doc, type); // if there was a definition then remove it this->Internal->VarStack.top().Set(name, 0); } @@ -2499,12 +2499,10 @@ std::vector<std::string> cmMakefile 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() ) - { - res.push_back(cit.GetName()); - } + std::vector<std::string> cacheKeys = + this->GetCacheManager()->GetCacheEntryKeys(); + res.insert(res.end(), cacheKeys.begin(), cacheKeys.end()); + std::sort(res.begin(), res.end()); return res; } |