diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-04-12 08:48:17 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-04-13 19:11:23 (GMT) |
commit | 97e53ebb3cd728e6091f93cb7d4eac91ae417bdb (patch) | |
tree | b346fb697dc5af34cf0f0ad04c963e7230f61ac3 /Source/cmake.cxx | |
parent | 1e738bcf9c7952bc9ae9bfb1be831c9f16998f54 (diff) | |
download | CMake-97e53ebb3cd728e6091f93cb7d4eac91ae417bdb.zip CMake-97e53ebb3cd728e6091f93cb7d4eac91ae417bdb.tar.gz CMake-97e53ebb3cd728e6091f93cb7d4eac91ae417bdb.tar.bz2 |
cmake: Simplify command clean up loop.
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index b852e00..6518207 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -197,27 +197,20 @@ void cmake::InitializeProperties() void cmake::CleanupCommandsAndMacros() { this->InitializeProperties(); - std::vector<cmCommand*> commands; for(RegisteredCommandsMap::iterator j = this->Commands.begin(); - j != this->Commands.end(); ++j) + j != this->Commands.end(); ) { - if ( !j->second->IsA("cmMacroHelperCommand") && - !j->second->IsA("cmFunctionHelperCommand")) + if (j->second->IsA("cmMacroHelperCommand") || + j->second->IsA("cmFunctionHelperCommand")) { - commands.push_back(j->second); + delete j->second; + this->Commands.erase(j++); } else { - delete j->second; + ++j; } } - this->Commands.clear(); - std::vector<cmCommand*>::iterator it; - for ( it = commands.begin(); it != commands.end(); - ++ it ) - { - this->Commands[cmSystemTools::LowerCase((*it)->GetName())] = *it; - } } bool cmake::CommandExists(const std::string& name) const |