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/Applications/SystemMonitor/ProcessModel.cpp | |
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/Applications/SystemMonitor/ProcessModel.cpp')
-rw-r--r-- | Userland/Applications/SystemMonitor/ProcessModel.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/Userland/Applications/SystemMonitor/ProcessModel.cpp b/Userland/Applications/SystemMonitor/ProcessModel.cpp index 3fddf1e9e6..d0a1b55ced 100644 --- a/Userland/Applications/SystemMonitor/ProcessModel.cpp +++ b/Userland/Applications/SystemMonitor/ProcessModel.cpp @@ -328,14 +328,14 @@ void ProcessModel::update() HashTable<int> live_tids; u64 sum_ticks_scheduled = 0, sum_ticks_scheduled_kernel = 0; if (all_processes.has_value()) { - for (auto& it : all_processes.value()) { - for (auto& thread : it.value.threads) { + for (auto& process : all_processes.value()) { + for (auto& thread : process.threads) { ThreadState state; - state.kernel = it.value.kernel; - state.pid = it.value.pid; - state.user = it.value.username; - state.pledge = it.value.pledge; - state.veil = it.value.veil; + state.kernel = process.kernel; + state.pid = process.pid; + state.user = process.username; + state.pledge = process.pledge; + state.veil = process.veil; state.syscall_count = thread.syscall_count; state.inode_faults = thread.inode_faults; state.zero_faults = thread.zero_faults; @@ -346,20 +346,20 @@ void ProcessModel::update() state.ipv4_socket_write_bytes = thread.ipv4_socket_write_bytes; state.file_read_bytes = thread.file_read_bytes; state.file_write_bytes = thread.file_write_bytes; - state.amount_virtual = it.value.amount_virtual; - state.amount_resident = it.value.amount_resident; - state.amount_dirty_private = it.value.amount_dirty_private; - state.amount_clean_inode = it.value.amount_clean_inode; - state.amount_purgeable_volatile = it.value.amount_purgeable_volatile; - state.amount_purgeable_nonvolatile = it.value.amount_purgeable_nonvolatile; + state.amount_virtual = process.amount_virtual; + state.amount_resident = process.amount_resident; + state.amount_dirty_private = process.amount_dirty_private; + state.amount_clean_inode = process.amount_clean_inode; + state.amount_purgeable_volatile = process.amount_purgeable_volatile; + state.amount_purgeable_nonvolatile = process.amount_purgeable_nonvolatile; state.name = thread.name; - state.executable = it.value.executable; + state.executable = process.executable; - state.ppid = it.value.ppid; + state.ppid = process.ppid; state.tid = thread.tid; - state.pgid = it.value.pgid; - state.sid = it.value.sid; + state.pgid = process.pgid; + state.sid = process.sid; state.ticks_user = thread.ticks_user; state.ticks_kernel = thread.ticks_kernel; state.cpu = thread.cpu; |