diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2016-12-16 17:48:37 -0800 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2016-12-16 17:48:37 -0800 |
| commit | e4571e75c2e572ef6a9f094bdd00326f8711e195 (patch) | |
| tree | eee245c83a891a4e1c93e25a28f3998e15c9b7f1 | |
| parent | 843e390c94cae55fdd4d411fc5c96f399af0f6f0 (diff) | |
| download | vcpkg-e4571e75c2e572ef6a9f094bdd00326f8711e195.tar.gz vcpkg-e4571e75c2e572ef6a9f094bdd00326f8711e195.zip | |
Do the trim and empty string erase in separate passes
| -rw-r--r-- | toolsrc/src/vcpkg_Strings.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index 403900dae..d2e153ede 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -109,9 +109,13 @@ namespace vcpkg {namespace Strings void trim_all_and_remove_whitespace_strings(std::vector<std::string>* strings) { - strings->erase(std::remove_if(strings->begin(), strings->end(), [](std::string& s)-> bool + for (std::string& s : *strings) + { + trim(&s); + } + + strings->erase(std::remove_if(strings->begin(), strings->end(), [](const std::string& s)-> bool { - trim(&s); return s == ""; }), strings->end()); } |
