Userland+LibCore: Use CProcessStatisticsReader to implement top.

Also tweaked CProcessStatisticsReader a bit to simplify the API.
This commit is contained in:
Andreas Kling 2019-07-10 13:56:28 +02:00
commit 01216f3c3f
Notes: sideshowbarker 2024-07-19 13:21:10 +09:00
5 changed files with 52 additions and 72 deletions

View file

@ -12,7 +12,7 @@ static int pid_of(const String& process_name, bool single_shot, bool omit_pid, p
{
bool displayed_at_least_one = false;
HashMap<pid_t, CProcessStatistics> processes = CProcessStatisticsReader().get_map();
auto processes = CProcessStatisticsReader().get_all();
for (auto& it : processes) {
if (it.value.name == process_name) {