From: Alexander Butenko Date: Sat, 2 Jul 2011 18:19:16 +0000 (-0400) Subject: Don't do pattern matching if link was matched by key X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac78646f83215048566236e14e0a97c21d5b302d;p=midori Don't do pattern matching if link was matched by key --- diff --git a/extensions/adblock.c b/extensions/adblock.c index 7eb1704e..dcde78de 100644 --- a/extensions/adblock.c +++ b/extensions/adblock.c @@ -678,8 +678,6 @@ static gboolean adblock_is_matched (const gchar* req_uri, const gchar* page_uri) { - gboolean foundbykey; - gboolean foundbypattern; gchar* value; if ((value = g_hash_table_lookup (urlcache, req_uri))) @@ -690,9 +688,13 @@ adblock_is_matched (const gchar* req_uri, return TRUE; } - foundbykey = adblock_is_matched_by_key (req_uri, page_uri); - foundbypattern = adblock_is_matched_by_pattern (req_uri, page_uri); - if (foundbykey == TRUE || foundbypattern == TRUE) + if (adblock_is_matched_by_key (req_uri, page_uri)) + { + g_hash_table_insert (urlcache, g_strdup (req_uri), g_strdup("1")); + return TRUE; + } + + if (adblock_is_matched_by_pattern (req_uri, page_uri)) { g_hash_table_insert (urlcache, g_strdup (req_uri), g_strdup("1")); return TRUE;