1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-05-08 02:34:06 +02:00

Remove RegexOptions.Compiled where not needed

This commit is contained in:
chylex 2019-09-05 00:16:25 +02:00
parent 19f104239a
commit 2459d31bff
3 changed files with 3 additions and 4 deletions
Core/Handling
lib/TweetLib.Core/Features/Twitter

View File

@ -11,7 +11,7 @@
namespace TweetDuck.Core.Handling{
class RequestHandlerBase : DefaultRequestHandler{
private static readonly Regex TweetDeckResourceUrl = new Regex(@"/dist/(.*?)\.(.*?)\.(css|js)$", RegexOptions.Compiled);
private static readonly Regex TweetDeckResourceUrl = new Regex(@"/dist/(.*?)\.(.*?)\.(css|js)$");
private static readonly SortedList<string, string> TweetDeckHashes = new SortedList<string, string>(4);
public static void LoadResourceRewriteRules(string rules){

View File

@ -5,7 +5,7 @@
namespace TweetLib.Core.Features.Twitter{
public class ImageUrl{
private static readonly Regex RegexImageUrlParams = new Regex(@"(format|name)=(\w+)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
private static readonly Regex RegexImageUrlParams = new Regex(@"(format|name)=(\w+)", RegexOptions.IgnoreCase);
public static readonly string[] ValidExtensions = {
".jpg", ".jpeg", ".png", ".gif"

View File

@ -7,8 +7,7 @@ public static class TwitterUrls{
public const string TweetDeck = "https://tweetdeck.twitter.com";
private const string TwitterTrackingUrl = "t.co";
private static readonly Lazy<Regex> RegexAccountLazy = new Lazy<Regex>(() => new Regex(@"^https?://twitter\.com/(?!signup$|tos$|privacy$|search$|search-)([^/?]+)/?$", RegexOptions.Compiled), false);
public static Regex RegexAccount => RegexAccountLazy.Value;
public static Regex RegexAccount { get; } = new Regex(@"^https?://twitter\.com/(?!signup$|tos$|privacy$|search$|search-)([^/?]+)/?$");
public static bool IsTweetDeck(string url){
return url.Contains("//tweetdeck.twitter.com/");