Reduce string allocations

Some simple changes to reduce the number of allocated strings
This commit is contained in:
Bond_009
2023-10-06 00:40:09 +02:00
parent 40f7eb4e8c
commit b176beb88e
21 changed files with 63 additions and 97 deletions

View File

@@ -2041,9 +2041,9 @@ public class DynamicHlsController : BaseJellyfinApiController
return null;
}
var playlistFilename = Path.GetFileNameWithoutExtension(playlist);
var playlistFilename = Path.GetFileNameWithoutExtension(playlist.AsSpan());
var indexString = Path.GetFileNameWithoutExtension(file.Name).Substring(playlistFilename.Length);
var indexString = Path.GetFileNameWithoutExtension(file.Name.AsSpan()).Slice(playlistFilename.Length);
return int.Parse(indexString, NumberStyles.Integer, CultureInfo.InvariantCulture);
}