Use functions directly instead of grabbing many locks at once

main
Simon Quigley 6 days ago
parent 1ecec033f1
commit 9a35473d37

@ -577,24 +577,18 @@ std::vector<std::shared_ptr<PackageConf>> CiLogic::get_config(const std::string
: (a->package->name > b->package->name);
}
} else if (sort_by == "build_status") {
int a_successful_task_count = a->successful_task_count();
int b_successful_task_count = b->successful_task_count();
int a_successful_or_pending_task_count = a->successful_or_pending_task_count();
int b_successful_or_pending_task_count = b->successful_or_pending_task_count();
int a_successful_or_queued_task_count = a->successful_or_queued_task_count();
int b_successful_or_queued_task_count = b->successful_or_queued_task_count();
if (a_successful_task_count != b_successful_task_count) {
if (a->successful_task_count() != b->successful_task_count()) {
return (order == "asc")
? (a_successful_task_count < b_successful_task_count)
: (a_successful_task_count > b_successful_task_count);
} else if (a_successful_or_pending_task_count != b_successful_or_pending_task_count) {
? (a->successful_task_count() < b->successful_task_count())
: (a->successful_task_count() > b->successful_task_count());
} else if (a->successful_or_pending_task_count() != b->successful_or_pending_task_count()) {
return (order == "asc")
? (a_successful_or_pending_task_count < b_successful_or_pending_task_count)
: (a_successful_or_pending_task_count > b_successful_or_pending_task_count);
} else if (a_successful_or_queued_task_count != b_successful_or_queued_task_count) {
? (a->successful_or_pending_task_count() < b->successful_or_pending_task_count())
: (a->successful_or_pending_task_count() > b->successful_or_pending_task_count());
} else if (a->successful_or_queued_task_count() != b->successful_or_queued_task_count()) {
return (order == "asc")
? (a_successful_or_queued_task_count < b_successful_or_queued_task_count)
: (a_successful_or_queued_task_count > b_successful_or_queued_task_count);
? (a->successful_or_queued_task_count() < b->successful_or_queued_task_count())
: (a->successful_or_queued_task_count() > b->successful_or_queued_task_count());
} else {
return (order == "asc")
? (a->total_task_count() < b->total_task_count())

Loading…
Cancel
Save