Console: Stop `tasks` from hanging in `std::sort`.

`std::sort` expects a comparator that returns `a < b`. Flipping this to `a >= b`
would normally be fine to reverse the order, but floats behave weirdly with NaN.

Instead of flipping the comparator, this uses the reverse-iterators to reverse
the sort order of the tasks, and returns to an `a < b` comparator.
custom
Tursiae 2 months ago
parent 5275b5ebcb
commit f12168b1b9
  1. 4
      src/tangara/app_console/app_console.cpp

@ -286,9 +286,9 @@ int CmdTasks(int argc, char** argv) {
}
}
std::sort(info_strings.begin(), info_strings.end(),
std::sort(info_strings.rbegin(), info_strings.rend(),
[](const auto& first, const auto& second) {
return first.first >= second.first;
return first.first < second.first;
});
std::cout << "name\t\t";

Loading…
Cancel
Save