]> spindle.queued.net Git - midori/commitdiff
Don't do pattern matching if link was matched by key
authorAlexander Butenko <a.butenka@gmail.com>
Sat, 2 Jul 2011 18:19:16 +0000 (14:19 -0400)
committerChristian Dywan <christian@twotoasts.de>
Tue, 5 Jul 2011 01:55:53 +0000 (03:55 +0200)
extensions/adblock.c

index 7eb1704e55fc11d89de20e243499170c53216937..dcde78de2fdf6a91172653b3b3db02739d3b856c 100644 (file)
@@ -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;