From e31c0e3f3b9a12dcf280a1ec05fc58463a020d71 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Tue, 3 Nov 2009 17:11:07 +0100 Subject: Optimisation: Remove of the duplicated check for the command prefix. --- libempathy-gtk/empathy-chat.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c index d8acd3b4e..cfeb0073b 100644 --- a/libempathy-gtk/empathy-chat.c +++ b/libempathy-gtk/empathy-chat.c @@ -690,7 +690,8 @@ chat_send (EmpathyChat *chat, GStrv strv; guint strv_len; - if (!has_prefix_case (msg + 1, commands[i].prefix)) { + if (!has_prefix_case (msg + 1, commands[i].prefix) || + !g_ascii_isspace (msg + 1 + strlen (commands[i].prefix))) { continue; } @@ -699,11 +700,6 @@ chat_send (EmpathyChat *chat, * between args */ strv = chat_command_parse (msg + 1, commands[i].max_parts); - if (g_ascii_strcasecmp (strv[0], commands[i].prefix) != 0) { - g_strfreev (strv); - continue; - } - strv_len = g_strv_length (strv); if (strv_len < commands[i].min_parts || strv_len > commands[i].max_parts) { -- cgit v1.2.3