diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-12 22:39:14 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-12 22:40:24 -0700 |
| commit | 3739e8e0b998b14c0f320c21618057e50698c51d (patch) | |
| tree | f1ac247ff23150db86ee94c1dbcaace9d5fc0dce /toolsrc/src/commands_integrate.cpp | |
| parent | b578320d9c3f282ecc8d0ee0d8564a321a31796d (diff) | |
| download | vcpkg-3739e8e0b998b14c0f320c21618057e50698c51d.tar.gz vcpkg-3739e8e0b998b14c0f320c21618057e50698c51d.zip | |
Use Util::keep_if()
Diffstat (limited to 'toolsrc/src/commands_integrate.cpp')
| -rw-r--r-- | toolsrc/src/commands_integrate.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/toolsrc/src/commands_integrate.cpp b/toolsrc/src/commands_integrate.cpp index 256c3ad1d..e51b1637e 100644 --- a/toolsrc/src/commands_integrate.cpp +++ b/toolsrc/src/commands_integrate.cpp @@ -3,6 +3,7 @@ #include "vcpkg_Checks.h" #include "vcpkg_System.h" #include "vcpkg_Files.h" +#include "vcpkg_Util.h" namespace vcpkg::Commands::Integrate { @@ -66,10 +67,10 @@ namespace vcpkg::Commands::Integrate dir_id.erase(1, 1); // Erasing the ":" // NuGet id cannot have invalid characters. We will only use alphanumeric and dot. - dir_id.erase(std::remove_if(dir_id.begin(), dir_id.end(), [](char c) - { - return !isalnum(c) && (c != '.'); - }), dir_id.end()); + Util::keep_if(dir_id, [](char c) + { + return isalnum(c) || (c == '.'); + }); const std::string nuget_id = "vcpkg." + dir_id; return nuget_id; |
