diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-06 17:37:19 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-07 15:45:13 -0700 |
| commit | cdc77fdae4c6084a2650757c95ee4497f484fa83 (patch) | |
| tree | d98cdb0368d4fdd620fb915b7ca1228cbb477902 /toolsrc/src/commands_remove.cpp | |
| parent | 26197ac316d27f9fed485206e70e568d5887caec (diff) | |
| download | vcpkg-cdc77fdae4c6084a2650757c95ee4497f484fa83.tar.gz vcpkg-cdc77fdae4c6084a2650757c95ee4497f484fa83.zip | |
RemovePlan -> sort by name
Diffstat (limited to 'toolsrc/src/commands_remove.cpp')
| -rw-r--r-- | toolsrc/src/commands_remove.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index cd8f81f92..b57137b56 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -101,14 +101,6 @@ namespace vcpkg::Commands::Remove write_update(paths, pkg); } - static void sort_packages_by_name(std::vector<const PackageSpecWithRemovePlan*>* packages) - { - std::sort(packages->begin(), packages->end(), [](const PackageSpecWithRemovePlan* left, const PackageSpecWithRemovePlan* right) -> bool - { - return left->spec.name() < right->spec.name(); - }); - } - static void print_plan(const std::vector<PackageSpecWithRemovePlan>& plan) { std::vector<const PackageSpecWithRemovePlan*> not_installed; @@ -131,7 +123,7 @@ namespace vcpkg::Commands::Remove if (!not_installed.empty()) { - sort_packages_by_name(¬_installed); + std::sort(not_installed.begin(), not_installed.end(), &PackageSpecWithRemovePlan::compare_by_name); System::println("The following packages are not installed, so not removed:\n%s", Strings::join("\n ", not_installed, [](const PackageSpecWithRemovePlan* p) { @@ -141,7 +133,7 @@ namespace vcpkg::Commands::Remove if (!remove.empty()) { - sort_packages_by_name(&remove); + std::sort(remove.begin(), remove.end(), &PackageSpecWithRemovePlan::compare_by_name); System::println("The following packages will be removed:\n%s", Strings::join("\n", remove, [](const PackageSpecWithRemovePlan* p) { |
