aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services
diff options
context:
space:
mode:
authorAndrey Sukharev <SukharevAndrey@users.noreply.github.com>2022-12-04 03:43:23 +0300
committerGitHub <noreply@github.com>2022-12-04 00:43:23 +0000
commit3868a0020611491e30db19e5b27d33a7559c7071 (patch)
tree4bb5bce15a9a4e37f111c5d53b0909cc92a3b4f7 /Ryujinx.HLE/HOS/Services
parent933e5144a975b324298d50032ec3fcce47a5fbf3 (diff)
Use source generated regular expressions (#4005)
Diffstat (limited to 'Ryujinx.HLE/HOS/Services')
-rw-r--r--Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/Proxy/DnsBlacklist.cs32
1 files changed, 22 insertions, 10 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/Proxy/DnsBlacklist.cs b/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/Proxy/DnsBlacklist.cs
index ddfe232c..776a6f7c 100644
--- a/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/Proxy/DnsBlacklist.cs
+++ b/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/Proxy/DnsBlacklist.cs
@@ -2,18 +2,30 @@
namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres.Proxy
{
- static class DnsBlacklist
+ static partial class DnsBlacklist
{
- const RegexOptions RegexOpts = RegexOptions.CultureInvariant | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture | RegexOptions.Compiled;
+ const RegexOptions RegexOpts = RegexOptions.CultureInvariant | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture;
- private static readonly Regex[] BlockedHosts = new Regex[]
- {
- new Regex(@"^(.*)\-lp1\.(n|s)\.n\.srv\.nintendo\.net$", RegexOpts),
- new Regex(@"^(.*)\-lp1\.lp1\.t\.npln\.srv\.nintendo\.net$", RegexOpts),
- new Regex(@"^(.*)\-lp1\.(znc|p)\.srv\.nintendo\.net$", RegexOpts),
- new Regex(@"^(.*)\-sb\-api\.accounts\.nintendo\.com$", RegexOpts),
- new Regex(@"^(.*)\-sb\.accounts\.nintendo\.com$", RegexOpts),
- new Regex(@"^accounts\.nintendo\.com$", RegexOpts)
+ [GeneratedRegex(@"^(.*)\-lp1\.(n|s)\.n\.srv\.nintendo\.net$", RegexOpts)]
+ private static partial Regex BlockedHost1();
+ [GeneratedRegex(@"^(.*)\-lp1\.lp1\.t\.npln\.srv\.nintendo\.net$", RegexOpts)]
+ private static partial Regex BlockedHost2();
+ [GeneratedRegex(@"^(.*)\-lp1\.(znc|p)\.srv\.nintendo\.net$", RegexOpts)]
+ private static partial Regex BlockedHost3();
+ [GeneratedRegex(@"^(.*)\-sb\-api\.accounts\.nintendo\.com$", RegexOpts)]
+ private static partial Regex BlockedHost4();
+ [GeneratedRegex(@"^(.*)\-sb\.accounts\.nintendo\.com$", RegexOpts)]
+ private static partial Regex BlockedHost5();
+ [GeneratedRegex(@"^accounts\.nintendo\.com$", RegexOpts)]
+ private static partial Regex BlockedHost6();
+
+ private static readonly Regex[] BlockedHosts = {
+ BlockedHost1(),
+ BlockedHost2(),
+ BlockedHost3(),
+ BlockedHost4(),
+ BlockedHost5(),
+ BlockedHost6()
};
public static bool IsHostBlocked(string host)