1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 06:47:34 +00:00

LibCore: Make ProcessStatisticsReader return results in a Vector

The HashMap API was overkill and made using this less ergonomic than
it should be.
This commit is contained in:
Andreas Kling 2021-05-23 11:08:32 +02:00
parent a345a1f4a1
commit a1e133cc6b
12 changed files with 79 additions and 83 deletions

View file

@ -270,8 +270,8 @@ bool generate_profile(pid_t& pid)
auto all_processes = Core::ProcessStatisticsReader::get_all();
if (all_processes.has_value()) {
if (auto it = all_processes.value().find(pid); it != all_processes.value().end())
process_name = it->value.name;
if (auto it = all_processes.value().find_if([&](auto& entry) { return entry.pid == pid; }); it != all_processes.value().end())
process_name = it->name;
else
process_name = "(unknown)";
} else {