diff options
| author | Bond_009 <Bond.009@outlook.com> | 2020-07-22 13:34:51 +0200 |
|---|---|---|
| committer | Bond_009 <Bond.009@outlook.com> | 2020-07-22 13:39:24 +0200 |
| commit | febb6bced6d2eb0941ed30205558ff8cf045720b (patch) | |
| tree | 829259605bb49dc01df569fee6e2919e51c47ecf /Emby.Server.Implementations/Library/LibraryManager.cs | |
| parent | 0750357916b600a4b4c27bc4babd2adcc6390473 (diff) | |
Review usage of string.Substring (part 1)
Reduced allocations by replacing string.Substring with ReadOnlySpan<char>.Slice
Diffstat (limited to 'Emby.Server.Implementations/Library/LibraryManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/Library/LibraryManager.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index c27b73c74..302d2a092 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/Emby.Server.Implementations/Library/LibraryManager.cs @@ -511,8 +511,8 @@ namespace Emby.Server.Implementations.Library { // Try to normalize paths located underneath program-data in an attempt to make them more portable key = key.Substring(_configurationManager.ApplicationPaths.ProgramDataPath.Length) - .TrimStart(new[] { '/', '\\' }) - .Replace("/", "\\"); + .TrimStart('/', '\\') + .Replace('/', '\\'); } if (forceCaseInsensitive || !_configurationManager.Configuration.EnableCaseSensitiveItemIds) |
