1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-09-17 15:02:34 +02:00

removed RegexOptions.IgnoreCase from some expressions. supposed to be faster.

This commit is contained in:
Keivan Beigi 2013-08-07 19:07:46 -07:00
parent 8900c32ae1
commit e152ecc55d
4 changed files with 9 additions and 8 deletions

View File

@ -7,6 +7,7 @@
namespace NzbDrone.Common.Test namespace NzbDrone.Common.Test
{ {
[TestFixture] [TestFixture]
[Timeout(15000)]
public class ServiceProviderTests : TestBase<ServiceProvider> public class ServiceProviderTests : TestBase<ServiceProvider>
{ {
private const string ALWAYS_INSTALLED_SERVICE = "SCardSvr"; //Smart Card private const string ALWAYS_INSTALLED_SERVICE = "SCardSvr"; //Smart Card

View File

@ -95,8 +95,8 @@ public static Param<string> IsRelativePath(this Param<string> param)
return param; return param;
} }
private static readonly Regex windowsInvalidPathRegex = new Regex(@"[/*<>""|]", RegexOptions.Compiled | RegexOptions.IgnoreCase); private static readonly Regex windowsInvalidPathRegex = new Regex(@"[/*<>""|]", RegexOptions.Compiled);
private static readonly Regex windowsPathRegex = new Regex(@"^[a-z]:\\", RegexOptions.Compiled | RegexOptions.IgnoreCase); private static readonly Regex windowsPathRegex = new Regex(@"^[a-zA-Z]:\\", RegexOptions.Compiled);
[DebuggerStepThrough] [DebuggerStepThrough]
public static Param<string> IsValidPath(this Param<string> param) public static Param<string> IsValidPath(this Param<string> param)

View File

@ -10,9 +10,9 @@ public static string Inject(this string format, params object[] formattingArgs)
return string.Format(format, formattingArgs); return string.Format(format, formattingArgs);
} }
private static readonly Regex InvalidCharRegex = new Regex(@"[^a-z0-9\s-]", RegexOptions.Compiled | RegexOptions.IgnoreCase); private static readonly Regex InvalidCharRegex = new Regex(@"[^a-zA-Z0-9\s-]", RegexOptions.Compiled);
private static readonly Regex InvalidSearchCharRegex = new Regex(@"[^a-z0-9\s-\.]", RegexOptions.Compiled | RegexOptions.IgnoreCase); private static readonly Regex InvalidSearchCharRegex = new Regex(@"[^a-zA-Z0-9\s-\.]", RegexOptions.Compiled);
private static readonly Regex CollapseSpace = new Regex(@"\s+", RegexOptions.Compiled | RegexOptions.IgnoreCase); private static readonly Regex CollapseSpace = new Regex(@"\s+", RegexOptions.Compiled);
public static string ToSlug(this string phrase) public static string ToSlug(this string phrase)
{ {

View File

@ -112,13 +112,13 @@ public static string ParseReleaseGroup(string title)
private static readonly Regex[] HeaderRegex = new[] private static readonly Regex[] HeaderRegex = new[]
{ {
new Regex(@"(?:\[.+\]\-\[.+\]\-\[.+\]\-\[)(?<nzbTitle>.+)(?:\]\-.+)", new Regex(@"(?:\[.+\]\-\[.+\]\-\[.+\]\-\[)(?<nzbTitle>.+)(?:\]\-.+)",
RegexOptions.IgnoreCase | RegexOptions.Compiled), RegexOptions.IgnoreCase),
new Regex(@"(?:\[.+\]\W+\[.+\]\W+\[.+\]\W+\"")(?<nzbTitle>.+)(?:\"".+)", new Regex(@"(?:\[.+\]\W+\[.+\]\W+\[.+\]\W+\"")(?<nzbTitle>.+)(?:\"".+)",
RegexOptions.IgnoreCase | RegexOptions.Compiled), RegexOptions.IgnoreCase),
new Regex(@"(?:\[)(?<nzbTitle>.+)(?:\]\-.+)", new Regex(@"(?:\[)(?<nzbTitle>.+)(?:\]\-.+)",
RegexOptions.IgnoreCase | RegexOptions.Compiled), RegexOptions.IgnoreCase),
}; };
public static string ParseHeader(string header) public static string ParseHeader(string header)