diff options
author | Andrey Sukharev <SukharevAndrey@users.noreply.github.com> | 2022-12-04 03:43:23 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-04 00:43:23 +0000 |
commit | 3868a0020611491e30db19e5b27d33a7559c7071 (patch) | |
tree | 4bb5bce15a9a4e37f111c5d53b0909cc92a3b4f7 /Ryujinx.HLE/HOS/Applets/Error/ErrorApplet.cs | |
parent | 933e5144a975b324298d50032ec3fcce47a5fbf3 (diff) |
Use source generated regular expressions (#4005)1.1.417
Diffstat (limited to 'Ryujinx.HLE/HOS/Applets/Error/ErrorApplet.cs')
-rw-r--r-- | Ryujinx.HLE/HOS/Applets/Error/ErrorApplet.cs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Ryujinx.HLE/HOS/Applets/Error/ErrorApplet.cs b/Ryujinx.HLE/HOS/Applets/Error/ErrorApplet.cs index 0ca90130..bd321f6f 100644 --- a/Ryujinx.HLE/HOS/Applets/Error/ErrorApplet.cs +++ b/Ryujinx.HLE/HOS/Applets/Error/ErrorApplet.cs @@ -18,7 +18,7 @@ using System.Text.RegularExpressions; namespace Ryujinx.HLE.HOS.Applets.Error { - internal class ErrorApplet : IApplet + internal partial class ErrorApplet : IApplet { private const long ErrorMessageBinaryTitleId = 0x0100000000000801; @@ -30,6 +30,9 @@ namespace Ryujinx.HLE.HOS.Applets.Error public event EventHandler AppletStateChanged; + [GeneratedRegex(@"[^\u0000\u0009\u000A\u000D\u0020-\uFFFF]..")] + private static partial Regex CleanTextRegex(); + public ErrorApplet(Horizon horizon) { _horizon = horizon; @@ -101,7 +104,7 @@ namespace Ryujinx.HLE.HOS.Applets.Error private static string CleanText(string value) { - return Regex.Replace(value, @"[^\u0000\u0009\u000A\u000D\u0020-\uFFFF]..", "").Replace("\0", ""); + return CleanTextRegex().Replace(value, "").Replace("\0", ""); } private string GetMessageText(uint module, uint description, string key) |