summaryrefslogtreecommitdiff
path: root/Userland/DevTools
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-05-23 11:08:32 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-23 11:10:15 +0200
commita1e133cc6bf8617d8299e4f1ae8df7b7d5289205 (patch)
treed473905c402aa6d82357ee82e8591aff4b20e39c /Userland/DevTools
parenta345a1f4a155ae62fb218f7f4c13d08911a73397 (diff)
downloadserenity-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.cpp4
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 {