diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-02-15 15:22:08 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-02-15 19:47:51 (GMT) |
commit | 1c7c35c3723abfb91f5e9a986ccd4f7e70683baf (patch) | |
tree | 8507fab18a5336199e01b9b89519134f061ff475 /Source | |
parent | cebeed248606ba92597b7e32a5b0be1f474f7a91 (diff) | |
download | CMake-1c7c35c3723abfb91f5e9a986ccd4f7e70683baf.zip CMake-1c7c35c3723abfb91f5e9a986ccd4f7e70683baf.tar.gz CMake-1c7c35c3723abfb91f5e9a986ccd4f7e70683baf.tar.bz2 |
cmListCommand: Replace remove duplicates loop with algorithm.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmListCommand.cxx | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index 50adce6..e2ebe0a 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -418,24 +418,9 @@ bool cmListCommand return false; } - std::string value; - - - std::set<std::string> unique; - std::vector<std::string>::iterator it; - const char* sep = ""; - for ( it = varArgsExpanded.begin(); it != varArgsExpanded.end(); ++ it ) - { - if (unique.find(*it) != unique.end()) - { - continue; - } - unique.insert(*it); - value += sep; - value += it->c_str(); - sep = ";"; - } - + varArgsExpanded.erase(cmRemoveDuplicates(varArgsExpanded), + varArgsExpanded.end()); + std::string value = cmJoin(varArgsExpanded, ";"); this->Makefile->AddDefinition(listName, value.c_str()); return true; |