aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-03-31 17:23:23 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-03-31 17:23:23 +0400
commitb06c9c6e186599df1ce7e18352372ee5356684bd (patch)
tree9b46466330ea5ae5006a020ef00c1fbf9da993dc /src
parent638d137e4912c782ba6e2bced821857dbcdd99bb (diff)
downloadrspamd-b06c9c6e186599df1ce7e18352372ee5356684bd.tar.gz
rspamd-b06c9c6e186599df1ce7e18352372ee5356684bd.zip
* Optimize speed of regexp_match_number function by avoid of regexp checks when threshold is already reached
Diffstat (limited to 'src')
-rw-r--r--src/plugins/regexp.c3
1 files changed, 3 insertions, 0 deletions
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);
}