Use source generated regular expressions (#4005)
This commit is contained in:
parent
933e5144a9
commit
3868a00206
5 changed files with 42 additions and 19 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue