diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-04-05 08:48:04 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-04-08 16:47:00 (GMT) |
commit | ba404938a202b51bb82bff8692ed08e53b061ad4 (patch) | |
tree | 445c969ae57dc9656e791af23b0b9f6830c6d255 /Source/cmMarkAsAdvancedCommand.cxx | |
parent | f3922a9a5b463420db5f7fae08efdf1b4abdfe5e (diff) | |
download | CMake-ba404938a202b51bb82bff8692ed08e53b061ad4.zip CMake-ba404938a202b51bb82bff8692ed08e53b061ad4.tar.gz CMake-ba404938a202b51bb82bff8692ed08e53b061ad4.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/cmMarkAsAdvancedCommand.cxx')
-rw-r--r-- | Source/cmMarkAsAdvancedCommand.cxx | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/Source/cmMarkAsAdvancedCommand.cxx b/Source/cmMarkAsAdvancedCommand.cxx index f6a2c26..cc094b1 100644 --- a/Source/cmMarkAsAdvancedCommand.cxx +++ b/Source/cmMarkAsAdvancedCommand.cxx @@ -37,24 +37,19 @@ bool cmMarkAsAdvancedCommand { std::string variable = args[i]; cmCacheManager* manager = this->Makefile->GetCacheManager(); - cmCacheManager::CacheIterator it = - manager->GetCacheIterator(variable.c_str()); - if ( it.IsAtEnd() ) + if (!manager->GetCacheEntryValue(variable)) { - this->Makefile->GetCacheManager() - ->AddCacheEntry(variable, 0, 0, - cmCacheManager::UNINITIALIZED); + manager->AddCacheEntry(variable, 0, 0, cmCacheManager::UNINITIALIZED); overwrite = true; } - it.Find(variable); - if ( it.IsAtEnd() ) + if (!manager->GetCacheEntryValue(variable)) { cmSystemTools::Error("This should never happen..."); return false; } - if ( !it.PropertyExists("ADVANCED") || overwrite ) + if (!manager->GetCacheEntryProperty(variable, "ADVANCED") || overwrite) { - it.SetProperty("ADVANCED", value); + manager->SetCacheEntryProperty(variable, "ADVANCED", value); } } return true; |