diff options
author | Stephen Kelly <steveire@gmail.com> | 2014-11-22 10:00:45 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-01-11 16:00:55 (GMT) |
commit | 238dd2fbab1bd4fb53a25dcd07c1ee41da46d451 (patch) | |
tree | 2ad1d3c2057e6d568fb55da0a9b872f992cb06d6 /Source/cmCustomCommand.cxx | |
parent | 2f7ef7e38d7aad93f5d25efb4fd7f61468cf06a2 (diff) | |
download | CMake-238dd2fbab1bd4fb53a25dcd07c1ee41da46d451.zip CMake-238dd2fbab1bd4fb53a25dcd07c1ee41da46d451.tar.gz CMake-238dd2fbab1bd4fb53a25dcd07c1ee41da46d451.tar.bz2 |
Use insert instead of a loop in some cases.
Limit this change to inserting into a vector from a vector.
A follow up change can use insert for inserting into a set.
Diffstat (limited to 'Source/cmCustomCommand.cxx')
-rw-r--r-- | Source/cmCustomCommand.cxx | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/Source/cmCustomCommand.cxx b/Source/cmCustomCommand.cxx index 2afb029..015825d 100644 --- a/Source/cmCustomCommand.cxx +++ b/Source/cmCustomCommand.cxx @@ -131,21 +131,14 @@ const char* cmCustomCommand::GetComment() const //---------------------------------------------------------------------------- void cmCustomCommand::AppendCommands(const cmCustomCommandLines& commandLines) { - for(cmCustomCommandLines::const_iterator i=commandLines.begin(); - i != commandLines.end(); ++i) - { - this->CommandLines.push_back(*i); - } + this->CommandLines.insert(this->CommandLines.end(), + commandLines.begin(), commandLines.end()); } //---------------------------------------------------------------------------- void cmCustomCommand::AppendDepends(const std::vector<std::string>& depends) { - for(std::vector<std::string>::const_iterator i=depends.begin(); - i != depends.end(); ++i) - { - this->Depends.push_back(*i); - } + this->Depends.insert(this->Depends.end(), depends.begin(), depends.end()); } //---------------------------------------------------------------------------- |