blakepell / AvalonMudClient

A Windows MUD client written in C#/WPF for .NET 8.
Other
31 stars 7 forks source link

Trigger / GagElementGenerator efficiency #39

Closed blakepell closed 3 years ago

blakepell commented 4 years ago

Expose the underlying Regex so that the GagElementGenerator can call it directly. Gags are unique in that they can be called repeatedly on lines from the AvalonTerminal (e.g. AvalonEdit) but will never need to process a command or go through any of the additional overhead. Currently the Trigger class calls Regex.Match directory because the returned object is needed to process groups. The GagElementGenerator however can call IsMatch which doesn't need to create the Match object and simply returns a true of false.

1.) Expose the Regex as a public property. 2.) Change the GagElementGenerator to call the Regex.IsMatch method directly.