diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-06 17:30:17 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-07 15:45:13 -0700 |
| commit | 26197ac316d27f9fed485206e70e568d5887caec (patch) | |
| tree | 8cae8cb89f4c6febdfaa8542e67cfc86a242187b /toolsrc/src/commands_remove.cpp | |
| parent | b36250344a8ef171bdd489d8b106ca325dbd32c7 (diff) | |
| download | vcpkg-26197ac316d27f9fed485206e70e568d5887caec.tar.gz vcpkg-26197ac316d27f9fed485206e70e568d5887caec.zip | |
Use switch-case
Diffstat (limited to 'toolsrc/src/commands_remove.cpp')
| -rw-r--r-- | toolsrc/src/commands_remove.cpp | 16 |
1 files 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); })); } } |
