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:
parent
a345a1f4a1
commit
a1e133cc6b
12 changed files with 79 additions and 83 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue