From 0b94213af7fd0b707e07ddd5673aba81c463d681 Mon Sep 17 00:00:00 2001 From: Archi Date: Fri, 22 Mar 2024 01:10:39 +0100 Subject: [PATCH] Misc We originally had ifdefs here for netf, so const made sense, they don't anymore. --- ArchiSteamFarm/Core/GeneratedRegexes.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/ArchiSteamFarm/Core/GeneratedRegexes.cs b/ArchiSteamFarm/Core/GeneratedRegexes.cs index cd7eb1cbb6a32..f0b26cbcb977d 100644 --- a/ArchiSteamFarm/Core/GeneratedRegexes.cs +++ b/ArchiSteamFarm/Core/GeneratedRegexes.cs @@ -26,21 +26,17 @@ namespace ArchiSteamFarm.Core; internal static partial class GeneratedRegexes { - private const string CdKeyPattern = @"^[0-9A-Z]{4,7}-[0-9A-Z]{4,7}-[0-9A-Z]{4,7}(?:(?:-[0-9A-Z]{4,7})?(?:-[0-9A-Z]{4,7}))?$"; - private const string DecimalPattern = @"[0-9\.,]+"; private const RegexOptions DefaultOptions = RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.IgnoreCase; - private const string DigitsPattern = @"\d+"; - private const string NonAsciiPattern = @"[^\u0000-\u007F]+"; - [GeneratedRegex(CdKeyPattern, DefaultOptions)] + [GeneratedRegex(@"^[0-9A-Z]{4,7}-[0-9A-Z]{4,7}-[0-9A-Z]{4,7}(?:(?:-[0-9A-Z]{4,7})?(?:-[0-9A-Z]{4,7}))?$", DefaultOptions)] internal static partial Regex CdKey(); - [GeneratedRegex(DecimalPattern, DefaultOptions)] + [GeneratedRegex(@"[0-9\.,]+", DefaultOptions)] internal static partial Regex Decimal(); - [GeneratedRegex(DigitsPattern, DefaultOptions)] + [GeneratedRegex(@"\d+", DefaultOptions)] internal static partial Regex Digits(); - [GeneratedRegex(NonAsciiPattern, DefaultOptions)] + [GeneratedRegex(@"[^\u0000-\u007F]+", DefaultOptions)] internal static partial Regex NonAscii(); }