mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Fixes using Matches+Count instead of IsMatch negatively affecting performance
This commit is contained in:
@ -134,7 +134,7 @@ namespace osu.Game.Online.Chat
|
|||||||
{
|
{
|
||||||
string fullName = Regex.Escape(username);
|
string fullName = Regex.Escape(username);
|
||||||
string underscoreName = Regex.Escape(username.Replace(' ', '_'));
|
string underscoreName = Regex.Escape(username.Replace(' ', '_'));
|
||||||
return new Regex($"\\b({fullName}|{underscoreName})\\b", RegexOptions.IgnoreCase).Matches(message).Count > 0;
|
return new Regex($"\\b({fullName}|{underscoreName})\\b", RegexOptions.IgnoreCase).IsMatch(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class PrivateMessageNotification : OpenChannelNotification
|
public class PrivateMessageNotification : OpenChannelNotification
|
||||||
|
Reference in New Issue
Block a user