From: Vsevolod Stakhov Date: Tue, 31 Mar 2009 13:23:23 +0000 (+0400) Subject: * Optimize speed of regexp_match_number function by avoid of regexp checks when thres... X-Git-Tag: 0.2.7~204 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b06c9c6e186599df1ce7e18352372ee5356684bd;p=rspamd.git * Optimize speed of regexp_match_number function by avoid of regexp checks when threshold is already reached --- diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c index 8dadffcf1..d1de03588 100644 --- a/src/plugins/regexp.c +++ b/src/plugins/regexp.c @@ -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); }