]> source.dussan.org Git - rspamd.git/commitdiff
* Optimize speed of regexp_match_number function by avoid of regexp checks when thres...
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Tue, 31 Mar 2009 13:23:23 +0000 (17:23 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Tue, 31 Mar 2009 13:23:23 +0000 (17:23 +0400)
src/plugins/regexp.c

index 8dadffcf1d3f0cec3ae5bd05ec4a77347366faee..d1de0358835dac16f05f0715bd68f754b1203ab5 100644 (file)
@@ -427,6 +427,9 @@ rspamd_regexp_match_number (struct worker_task *task, GList *args)
                                re_cache_add (param_pattern, re);
                        }
                        res += process_regexp (re, task);
+                       if (res >= param_count) {
+                               return TRUE;
+                       }
                }
                cur = g_list_next (cur);
        }