Explorar el Código

Fix usage of RegexOptions.Compiled

cvium hace 3 años
padre
commit
9e665ff520
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      Emby.Naming/Video/ExtraResolver.cs

+ 2 - 2
Emby.Naming/Video/ExtraResolver.cs

@@ -60,9 +60,9 @@ namespace Emby.Naming.Video
                 {
                     var filename = Path.GetFileName(path);
 
-                    var regex = new Regex(rule.Token, RegexOptions.IgnoreCase | RegexOptions.Compiled);
+                    var isMatch = Regex.IsMatch(filename, rule.Token, RegexOptions.IgnoreCase | RegexOptions.Compiled);
 
-                    if (regex.IsMatch(filename))
+                    if (isMatch)
                     {
                         result.ExtraType = rule.ExtraType;
                         result.Rule = rule;