diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-18 15:31:10 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-21 18:06:52 -0700 |
| commit | 6350eddd4689568ff8dcfe431e1bf81579fb0556 (patch) | |
| tree | e8912dcfcb7e833cf9626afa808cdf2eab5af485 /toolsrc/src/commands_remove.cpp | |
| parent | 989083caacfe44e442a88db851ded8e2b519c143 (diff) | |
| download | vcpkg-6350eddd4689568ff8dcfe431e1bf81579fb0556.tar.gz vcpkg-6350eddd4689568ff8dcfe431e1bf81579fb0556.zip | |
Find group_by_plan_type outside of print_plan()
Diffstat (limited to 'toolsrc/src/commands_remove.cpp')
| -rw-r--r-- | toolsrc/src/commands_remove.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index f26cf5dbf..225241bdf 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -87,13 +87,10 @@ namespace vcpkg::Commands::Remove write_update(paths, pkg); } - static void print_plan(const std::vector<RemovePlanAction>& plan) + static void print_plan(const std::map<RemovePlanType, std::vector<const RemovePlanAction*>>& group_by_plan_type) { static constexpr std::array<RemovePlanType, 2> order = { RemovePlanType::NOT_INSTALLED, RemovePlanType::REMOVE }; - std::map<RemovePlanType, std::vector<const RemovePlanAction*>> group_by_plan_type; - Util::group_by(plan, &group_by_plan_type, [](const RemovePlanAction& p) { return p.plan_type; }); - for (const RemovePlanType plan_type : order) { auto it = group_by_plan_type.find(plan_type); @@ -162,7 +159,9 @@ namespace vcpkg::Commands::Remove const std::vector<RemovePlanAction> remove_plan = Dependencies::create_remove_plan(specs, status_db); Checks::check_exit(VCPKG_LINE_INFO, !remove_plan.empty(), "Remove plan cannot be empty"); - print_plan(remove_plan); + std::map<RemovePlanType, std::vector<const RemovePlanAction*>> group_by_plan_type; + Util::group_by(remove_plan, &group_by_plan_type, [](const RemovePlanAction& p) { return p.plan_type; }); + print_plan(group_by_plan_type); const bool has_non_user_requested_packages = Util::find_if(remove_plan, [](const RemovePlanAction& package)-> bool { |
