From 971dd46aec0e06df26c5675aa0f49cbc4871283f Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 9 Mar 2019 16:20:46 +0100 Subject: Userland: Use AK::quick_sort() in /bin/top --- Userland/top.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Userland') diff --git a/Userland/top.cpp b/Userland/top.cpp index b14d9b0d99..a0c3350049 100644 --- a/Userland/top.cpp +++ b/Userland/top.cpp @@ -6,6 +6,7 @@ #include #include #include +#include static HashMap* s_usernames; @@ -112,10 +113,9 @@ int main(int, char**) processes.append(&it.value); } - qsort(processes.data(), processes.size(), sizeof(Process*), [] (const void* a, const void* b) -> int { - auto* p1 = *(const Process* const*)(a); - auto* p2 = *(const Process* const*)(b); - return p2->nsched_since_prev - p1->nsched_since_prev; + + quick_sort(processes.begin(), processes.end(), [] (auto* p1, auto* p2) { + return p2->nsched_since_prev < p1->nsched_since_prev; }); for (auto* process : processes) { -- cgit v1.2.3