From 79b29a9362fad97754471f8152aaf8ae1d1880ac Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Mon, 20 Feb 2012 21:58:03 +0100 Subject: [PATCH] Avoid string split in midori_location_action_popup_timeout_cb --- midori/midori-locationaction.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c index 93061b9b..ea42789f 100644 --- a/midori/midori-locationaction.c +++ b/midori/midori-locationaction.c @@ -418,20 +418,14 @@ midori_location_action_popup_timeout_cb (gpointer data) return FALSE; /* No completion when typing a search token */ - if (action->search_engines != NULL) + if (action->search_engines + && katze_array_find_token (action->search_engines, action->key)) { - gchar** parts = g_strsplit (action->key, " ", 2); - if (parts && *parts && parts[1] - && katze_array_find_token (action->search_engines, *parts)) - { - g_strfreev (parts); - midori_location_action_popdown_completion (action); - return FALSE; - } - g_strfreev (parts); + midori_location_action_popdown_completion (action); + return FALSE; } - /* Empaty string or starting with a space means: no completion */ + /* Empty string or starting with a space means: no completion */ if (!(action->key && *action->key && *action->key != ' ')) { midori_location_action_popdown_completion (action); -- 2.39.5