Reduce allocations

This commit is contained in:
Bond_009
2021-09-19 20:53:31 +02:00
parent a3a8e058bc
commit a6d1e542e6
14 changed files with 105 additions and 48 deletions

View File

@@ -4,6 +4,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Jellyfin.Extensions;
namespace MediaBrowser.Model.Net
{
@@ -221,7 +222,7 @@ namespace MediaBrowser.Model.Net
}
// handle text/html; charset=UTF-8
mimeType = mimeType.Split(';')[0];
mimeType = mimeType.AsSpan().LeftPart(';').ToString();
if (_extensionLookup.TryGetValue(mimeType, out string? result))
{