From 447dd3aed775f37ae97ddbab9e04a8281f1b389a Mon Sep 17 00:00:00 2001 From: gnattu Date: Mon, 12 Aug 2024 01:53:56 +0800 Subject: [PATCH] Use Math.Min Co-authored-by: Bond-009 --- MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index 6b9f8ebfd5..a853a2b2f8 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -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