From 10d76d1a227c59788f2da9606c7e316ee2ecc9f3 Mon Sep 17 00:00:00 2001 From: Evenprime Date: Sun, 4 Mar 2012 17:31:13 +0100 Subject: [PATCH] Avoid doing expensive regex matching in colorCheck --- src/cc/co/evenprime/bukkit/nocheat/checks/chat/ColorCheck.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/chat/ColorCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/chat/ColorCheck.java index 7527dcb6..6e3d8347 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/chat/ColorCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/chat/ColorCheck.java @@ -14,7 +14,7 @@ public class ColorCheck extends ChatCheck { public boolean check(NoCheatPlayer player, ChatData data, ChatConfig cc) { - if(data.message.matches(".*\247.*")) { + if(data.message.contains("\247")) { data.colorVL += 1; incrementStatistics(player, Id.CHAT_COLOR, 1);