Skip to content

Commit

Permalink
Optimize load average parsing in geph5-bridge by directly accessing s…
Browse files Browse the repository at this point in the history
…econd value
  • Loading branch information
nullchinchilla committed Jul 20, 2024
1 parent 899f2df commit 615b46c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions binaries/geph5-bridge/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ async fn broker_upload_loop(control_listen: SocketAddr, control_cookie: String)
let raw = std::fs::read("/proc/loadavg").unwrap();
String::from_utf8_lossy(&raw)
.split_ascii_whitespace()
.next()
.unwrap()
.collect::<Vec<_>>()[1]
.parse()
.unwrap()
};
Expand Down

0 comments on commit 615b46c

Please sign in to comment.