1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-12-05 09:14:28 +01:00

Fix list operation performance issue

This commit is contained in:
Bernd Schoolmann 2025-12-05 05:58:17 +01:00
parent 928da75b45
commit 3b9d8e2879
No known key found for this signature in database

View File

@ -3,8 +3,12 @@ use sysinfo::{Pid, System};
use super::models::PeerInfo;
pub fn get_peer_info(peer_pid: u32) -> Result<PeerInfo, String> {
let s = System::new_all();
if let Some(process) = s.process(Pid::from_u32(peer_pid)) {
let mut system = System::new();
system.refresh_processes(
sysinfo::ProcessesToUpdate::Some(&[Pid::from_u32(peer_pid)]),
true,
);
if let Some(process) = system.process(Pid::from_u32(peer_pid)) {
let peer_process_name = match process.name().to_str() {
Some(name) => name.to_string(),
None => {