Reduce again the number of match calls (#7815)

- Reduce the number of match calls (see commit messages)
- A few miscellaneous improvements
This commit is contained in:
Hofer-Julian
2023-01-24 12:23:42 +01:00
committed by GitHub
parent 0bb2e47c98
commit 41306aa7e0
49 changed files with 467 additions and 634 deletions

View File

@ -6,10 +6,9 @@ fn main() {
target_os = "windows"
))]
{
let cores = match std::thread::available_parallelism() {
Ok(p) => p.get(),
Err(_) => 1usize,
};
let cores = std::thread::available_parallelism()
.map(|p| p.get())
.unwrap_or(1);
for run in 1..=10 {
for proc in nu_system::collect_proc(std::time::Duration::from_millis(100), false) {
if proc.cpu_usage() > 0.00001 {