diff options
author | Andreas Kling <kling@serenityos.org> | 2021-05-23 11:08:32 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-23 11:10:15 +0200 |
commit | a1e133cc6bf8617d8299e4f1ae8df7b7d5289205 (patch) | |
tree | d473905c402aa6d82357ee82e8591aff4b20e39c /Userland/DevTools | |
parent | a345a1f4a155ae62fb218f7f4c13d08911a73397 (diff) | |
download | serenity-a1e133cc6bf8617d8299e4f1ae8df7b7d5289205.zip |
LibCore: Make ProcessStatisticsReader return results in a Vector
The HashMap API was overkill and made using this less ergonomic than
it should be.
Diffstat (limited to 'Userland/DevTools')
-rw-r--r-- | Userland/DevTools/Profiler/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/DevTools/Profiler/main.cpp b/Userland/DevTools/Profiler/main.cpp index 6cf7f55beb..6f85fef7a0 100644 --- a/Userland/DevTools/Profiler/main.cpp +++ b/Userland/DevTools/Profiler/main.cpp @@ -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 { |