Reduce string allocations by regex

This commit is contained in:
Bond_009
2023-02-17 15:00:06 +01:00
parent df8346cd63
commit 48263078b4
11 changed files with 22 additions and 62 deletions

View File

@@ -56,7 +56,7 @@ namespace Emby.Naming.Video
}
else if (rule.RuleType == ExtraRuleType.Regex)
{
var filename = Path.GetFileName(path);
var filename = Path.GetFileName(path.AsSpan());
var isMatch = Regex.IsMatch(filename, rule.Token, RegexOptions.IgnoreCase | RegexOptions.Compiled);