From 26197ac316d27f9fed485206e70e568d5887caec Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 6 Apr 2017 17:30:17 -0700 Subject: Use switch-case --- toolsrc/src/commands_remove.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 2e6807575..cd8f81f92 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -145,17 +145,15 @@ 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 == RequestType::AUTO_SELECTED) + switch (p->plan.request_type) { - return " * " + p->spec.to_string(); + case RequestType::AUTO_SELECTED: + return " * " + p->spec.to_string(); + case RequestType::USER_REQUESTED: + return " " + p->spec.to_string(); + default: + Checks::unreachable(VCPKG_LINE_INFO); } - - if (p->plan.request_type == RequestType::USER_REQUESTED) - { - return " " + p->spec.to_string(); - } - - Checks::unreachable(VCPKG_LINE_INFO); })); } } -- cgit v1.2.3