mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 06:30:08 +02:00
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:
@ -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 {
|
||||
|
Reference in New Issue
Block a user