summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx19
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