aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/DynamicHlsController.cs
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2023-10-06 00:40:09 +0200
committerBond_009 <bond.009@outlook.com>2023-10-06 01:04:25 +0200
commitb176beb88e22a36cc056439ac2a4df4fbe68f2c1 (patch)
tree46988cc14ba7e8bdd9d6eb89588b1472f6caa25d /Jellyfin.Api/Controllers/DynamicHlsController.cs
parent40f7eb4e8cd9e250fb3870a4799a5a8d949e2068 (diff)
Reduce string allocations
Some simple changes to reduce the number of allocated strings
Diffstat (limited to 'Jellyfin.Api/Controllers/DynamicHlsController.cs')
-rw-r--r--Jellyfin.Api/Controllers/DynamicHlsController.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Jellyfin.Api/Controllers/DynamicHlsController.cs b/Jellyfin.Api/Controllers/DynamicHlsController.cs
index 065a4ce5c..4026a38f8 100644
--- a/Jellyfin.Api/Controllers/DynamicHlsController.cs
+++ b/Jellyfin.Api/Controllers/DynamicHlsController.cs
@@ -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);
}