From b06c9c6e186599df1ce7e18352372ee5356684bd Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 31 Mar 2009 17:23:23 +0400 Subject: [PATCH] * Optimize speed of regexp_match_number function by avoid of regexp checks when threshold is already reached --- src/plugins/regexp.c | 3 +++ 1 file changed, 3 insertions(+) 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); } -- 2.39.5