aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-chat.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2009-11-04 00:11:07 +0800
committerXavier Claessens <xclaesse@gmail.com>2009-11-04 00:11:07 +0800
commite31c0e3f3b9a12dcf280a1ec05fc58463a020d71 (patch)
tree86b83a3aeb05b7a18557ec4734b9da49fb55bd4b /libempathy-gtk/empathy-chat.c
parent59e8855f553fdcd3d23d3f0788ec6628192f0892 (diff)
downloadgsoc2013-empathy-e31c0e3f3b9a12dcf280a1ec05fc58463a020d71.tar
gsoc2013-empathy-e31c0e3f3b9a12dcf280a1ec05fc58463a020d71.tar.gz
gsoc2013-empathy-e31c0e3f3b9a12dcf280a1ec05fc58463a020d71.tar.bz2
gsoc2013-empathy-e31c0e3f3b9a12dcf280a1ec05fc58463a020d71.tar.lz
gsoc2013-empathy-e31c0e3f3b9a12dcf280a1ec05fc58463a020d71.tar.xz
gsoc2013-empathy-e31c0e3f3b9a12dcf280a1ec05fc58463a020d71.tar.zst
gsoc2013-empathy-e31c0e3f3b9a12dcf280a1ec05fc58463a020d71.zip
Optimisation: Remove of the duplicated check for the command prefix.
Diffstat (limited to 'libempathy-gtk/empathy-chat.c')
-rw-r--r--libempathy-gtk/empathy-chat.c8
1 files changed, 2 insertions, 6 deletions
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) {