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_build.cpp | |
| parent | b578320d9c3f282ecc8d0ee0d8564a321a31796d (diff) | |
| download | vcpkg-3739e8e0b998b14c0f320c21618057e50698c51d.tar.gz vcpkg-3739e8e0b998b14c0f320c21618057e50698c51d.zip | |
Use Util::keep_if()
Diffstat (limited to 'toolsrc/src/commands_build.cpp')
| -rw-r--r-- | toolsrc/src/commands_build.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index c3ebd7de8..c7db764de 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -10,6 +10,7 @@ #include "metrics.h" #include "vcpkg_Enums.h" #include "Paragraphs.h" +#include "vcpkg_Util.h" namespace vcpkg::Commands::Build { @@ -149,12 +150,10 @@ namespace vcpkg::Commands::Build if (result == BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES) { std::vector<InstallPlanAction> unmet_dependencies = Dependencies::create_install_plan(paths, { spec }, status_db); - unmet_dependencies.erase( - std::remove_if(unmet_dependencies.begin(), unmet_dependencies.end(), [&spec](const InstallPlanAction& p) - { - return (p.spec == spec) || (p.plan_type == InstallPlanType::ALREADY_INSTALLED); - }), - unmet_dependencies.end()); + Util::keep_if(unmet_dependencies, [&spec](const InstallPlanAction& p) + { + return (p.spec != spec) && (p.plan_type != InstallPlanType::ALREADY_INSTALLED); + }); Checks::check_exit(VCPKG_LINE_INFO, !unmet_dependencies.empty()); System::println(System::Color::error, "The build command requires all dependencies to be already installed."); |
