Use Math.Min

Co-authored-by: Bond-009 <bond.009@outlook.com>
This commit is contained in:
gnattu 2024-08-12 01:53:56 +08:00 committed by GitHub
parent 2321866302
commit 447dd3aed7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6308,7 +6308,7 @@ namespace MediaBrowser.Controller.MediaEncoding
return 0;
}
return threads >= Environment.ProcessorCount ? Environment.ProcessorCount : threads;
return Math.Min(threads, Environment.ProcessorCount);
}
#nullable disable