mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 05:02:55 +08:00
Fixes using Matches+Count instead of IsMatch negatively affecting performance
This commit is contained in:
parent
f02e44d552
commit
7a0d4fca17
@ -134,7 +134,7 @@ namespace osu.Game.Online.Chat
|
||||
{
|
||||
string fullName = Regex.Escape(username);
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user