aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/commands_remove.cpp
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2017-04-06 17:28:49 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2017-04-07 15:45:13 -0700
commitb36250344a8ef171bdd489d8b106ca325dbd32c7 (patch)
treeaf5168981f87f35e13d40ca792b228ba4d70b81f /toolsrc/src/commands_remove.cpp
parentcdf4e5d014ddee19cceebc17400cfffbeef339d1 (diff)
downloadvcpkg-b36250344a8ef171bdd489d8b106ca325dbd32c7.tar.gz
vcpkg-b36250344a8ef171bdd489d8b106ca325dbd32c7.zip
Use switch-case
Diffstat (limited to 'toolsrc/src/commands_remove.cpp')
-rw-r--r--toolsrc/src/commands_remove.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp
index f5689067d..2e6807575 100644
--- a/toolsrc/src/commands_remove.cpp
+++ b/toolsrc/src/commands_remove.cpp
@@ -116,19 +116,17 @@ namespace vcpkg::Commands::Remove
for (const PackageSpecWithRemovePlan& i : plan)
{
- if (i.plan.plan_type == RemovePlanType::NOT_INSTALLED)
+ switch (i.plan.plan_type)
{
- not_installed.push_back(&i);
- continue;
- }
-
- if (i.plan.plan_type == RemovePlanType::REMOVE)
- {
- remove.push_back(&i);
- continue;
+ case RemovePlanType::NOT_INSTALLED:
+ not_installed.push_back(&i);
+ continue;
+ case RemovePlanType::REMOVE:
+ remove.push_back(&i);
+ continue;
+ default:
+ Checks::unreachable(VCPKG_LINE_INFO);
}
-
- Checks::unreachable(VCPKG_LINE_INFO);
}
if (!not_installed.empty())
@@ -147,12 +145,12 @@ namespace vcpkg::Commands::Remove
System::println("The following packages will be removed:\n%s",
Strings::join("\n", remove, [](const PackageSpecWithRemovePlan* p)
{
- if (p->plan.request_type == Dependencies::RequestType::AUTO_SELECTED)
+ if (p->plan.request_type == RequestType::AUTO_SELECTED)
{
return " * " + p->spec.to_string();
}
- if (p->plan.request_type == Dependencies::RequestType::USER_REQUESTED)
+ if (p->plan.request_type == RequestType::USER_REQUESTED)
{
return " " + p->spec.to_string();
}