diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-12-07 09:03:07 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-12-07 09:03:07 +0000 |
commit | 1a7a90ffb7398d070619518fe3011fd8886590c0 (patch) | |
tree | 06e6919464b306553613e550c419d1252d2ea161 | |
parent | 9347accacebdcb3015999cc9e04664e54c6535bb (diff) | |
download | rspamd-1a7a90ffb7398d070619518fe3011fd8886590c0.tar.gz rspamd-1a7a90ffb7398d070619518fe3011fd8886590c0.zip |
As we store re_class within re avoid extra lookup
-rw-r--r-- | src/libserver/re_cache.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libserver/re_cache.c b/src/libserver/re_cache.c index 1ba2a8234..d7f7c7b94 100644 --- a/src/libserver/re_cache.c +++ b/src/libserver/re_cache.c @@ -424,7 +424,7 @@ rspamd_re_cache_process (struct rspamd_task *task, gboolean is_strong, gboolean is_multiple) { - guint64 class_id, re_id; + guint64 re_id; struct rspamd_re_class *re_class; struct rspamd_re_cache *cache; @@ -447,8 +447,7 @@ rspamd_re_cache_process (struct rspamd_task *task, } else { /* Slow path */ - class_id = rspamd_re_cache_class_id (type, type_data, datalen); - re_class = g_hash_table_lookup (cache->re_classes, &class_id); + re_class = rspamd_regexp_get_class (re); if (re_class == NULL) { msg_err_task ("cannot find re class for regexp '%s'", |