diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-03-31 17:23:23 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-03-31 17:23:23 +0400 |
commit | b06c9c6e186599df1ce7e18352372ee5356684bd (patch) | |
tree | 9b46466330ea5ae5006a020ef00c1fbf9da993dc /src | |
parent | 638d137e4912c782ba6e2bced821857dbcdd99bb (diff) | |
download | rspamd-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.c | 3 |
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); } |