Use vector, not list for cmCommand storage.

This commit is contained in:
Stephen Kelly 2015-04-12 02:44:41 +02:00
parent 6deb43e6c8
commit 57dd094ede
6 changed files with 10 additions and 10 deletions

View File

@ -55,7 +55,7 @@
#include "cmPathLabel.cxx" #include "cmPathLabel.cxx"
#include "cmSearchPath.cxx" #include "cmSearchPath.cxx"
void GetBootstrapCommands1(std::list<cmCommand*>& commands) void GetBootstrapCommands1(std::vector<cmCommand*>& commands)
{ {
commands.push_back(new cmAddCustomCommandCommand); commands.push_back(new cmAddCustomCommandCommand);
commands.push_back(new cmAddCustomTargetCommand); commands.push_back(new cmAddCustomTargetCommand);

View File

@ -59,7 +59,7 @@
#include "cmUnsetCommand.cxx" #include "cmUnsetCommand.cxx"
#include "cmWhileCommand.cxx" #include "cmWhileCommand.cxx"
void GetBootstrapCommands2(std::list<cmCommand*>& commands) void GetBootstrapCommands2(std::vector<cmCommand*>& commands)
{ {
commands.push_back(new cmGetCMakePropertyCommand); commands.push_back(new cmGetCMakePropertyCommand);
commands.push_back(new cmGetDirectoryPropertyCommand); commands.push_back(new cmGetDirectoryPropertyCommand);

View File

@ -13,7 +13,7 @@
@COMMAND_INCLUDES@ @COMMAND_INCLUDES@
void GetPredefinedCommands(std::list<cmCommand*>& commands) void GetPredefinedCommands(std::vector<cmCommand*>& commands)
{ {
@NEW_COMMANDS@ @NEW_COMMANDS@
} }

View File

@ -13,7 +13,7 @@
#define cmCommands_h #define cmCommands_h
#include "cmStandardIncludes.h" #include "cmStandardIncludes.h"
#include <list> #include <vector>
class cmCommand; class cmCommand;
/** /**
@ -23,9 +23,9 @@ class cmCommand;
* It is up to the caller to delete the commands created by this * It is up to the caller to delete the commands created by this
* call. * call.
*/ */
void GetBootstrapCommands1(std::list<cmCommand*>& commands); void GetBootstrapCommands1(std::vector<cmCommand*>& commands);
void GetBootstrapCommands2(std::list<cmCommand*>& commands); void GetBootstrapCommands2(std::vector<cmCommand*>& commands);
void GetPredefinedCommands(std::list<cmCommand*>& commands); void GetPredefinedCommands(std::vector<cmCommand*>& commands);
#endif #endif

View File

@ -11,6 +11,6 @@
============================================================================*/ ============================================================================*/
#include "cmCommands.h" #include "cmCommands.h"
void GetPredefinedCommands(std::list<cmCommand*>&) void GetPredefinedCommands(std::vector<cmCommand*>&)
{ {
} }

View File

@ -1804,11 +1804,11 @@ const char* cmake::GetCacheDefinition(const std::string& name) const
void cmake::AddDefaultCommands() void cmake::AddDefaultCommands()
{ {
std::list<cmCommand*> commands; std::vector<cmCommand*> commands;
GetBootstrapCommands1(commands); GetBootstrapCommands1(commands);
GetBootstrapCommands2(commands); GetBootstrapCommands2(commands);
GetPredefinedCommands(commands); GetPredefinedCommands(commands);
for(std::list<cmCommand*>::iterator i = commands.begin(); for(std::vector<cmCommand*>::iterator i = commands.begin();
i != commands.end(); ++i) i != commands.end(); ++i)
{ {
this->AddCommand(*i); this->AddCommand(*i);