diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-02-15 15:00:54 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-02-15 18:56:09 (GMT) |
commit | 3cfe7a4ca876c496f9b491e4175fd1c9be24f3d7 (patch) | |
tree | 584f62b94525414743c918654181eafb91e2ed02 /Source/cmListCommand.cxx | |
parent | 050958a3286f69c577fe5d03407800cbe0367898 (diff) | |
download | CMake-3cfe7a4ca876c496f9b491e4175fd1c9be24f3d7.zip CMake-3cfe7a4ca876c496f9b491e4175fd1c9be24f3d7.tar.gz CMake-3cfe7a4ca876c496f9b491e4175fd1c9be24f3d7.tar.bz2 |
cmListCommand: Implement REMOVE_ITEM in terms of cmRemoveMatching.
Diffstat (limited to 'Source/cmListCommand.cxx')
-rw-r--r-- | Source/cmListCommand.cxx | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index 592681b..50adce6 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -355,23 +355,13 @@ bool cmListCommand return false; } - size_t cc; - for ( cc = 2; cc < args.size(); ++ cc ) - { - size_t kk = 0; - while ( kk < varArgsExpanded.size() ) - { - if ( varArgsExpanded[kk] == args[cc] ) - { - varArgsExpanded.erase(varArgsExpanded.begin()+kk); - } - else - { - kk ++; - } - } - } + std::vector<std::string> remove(args.begin() + 2, args.end()); + std::sort(remove.begin(), remove.end()); + remove.erase(std::unique(remove.begin(), remove.end()), remove.end()); + varArgsExpanded.erase( + cmRemoveMatching(varArgsExpanded, remove), + varArgsExpanded.end()); std::string value = cmJoin(varArgsExpanded, ";"); this->Makefile->AddDefinition(listName, value.c_str()); |