summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-10-08 19:21:20 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-10-08 19:21:20 +0100
commit2e2c66f6be03c03de7696918cc222047c70e9747 (patch)
treea71b5d69de012b83ac9eb87ffa9d00dd08917801
parenta10819e96987b1082fc503fa4a07409fc7ea31f2 (diff)
downloadrspamd-2e2c66f6be03c03de7696918cc222047c70e9747.tar.gz
rspamd-2e2c66f6be03c03de7696918cc222047c70e9747.zip
[Minor] Slightly optimize hash lookup
-rw-r--r--src/libserver/composites.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libserver/composites.c b/src/libserver/composites.c
index bf573ada7..41dd60b0c 100644
--- a/src/libserver/composites.c
+++ b/src/libserver/composites.c
@@ -102,8 +102,8 @@ rspamd_composite_process_single_symbol (struct composites_data *cd,
if ((ncomp =
g_hash_table_lookup (cd->task->cfg->composite_symbols,
sym)) != NULL) {
- /* Set checked for this symbol to avoid cyclic references */
if (isclr (cd->checked, ncomp->id * 2)) {
+ /* Set checked for this symbol to avoid cyclic references */
setbit (cd->checked, cd->composite->id * 2);
rc = rspamd_process_expression (ncomp->expr,
RSPAMD_EXPRESSION_FLAG_NOOPT, cd);
@@ -111,10 +111,10 @@ rspamd_composite_process_single_symbol (struct composites_data *cd,
if (rc) {
setbit (cd->checked, ncomp->id * 2 + 1);
+ ms = g_hash_table_lookup (cd->metric_res->symbols, sym);
}
- setbit (cd->checked, ncomp->id * 2);
- ms = g_hash_table_lookup (cd->metric_res->symbols, sym);
+ setbit (cd->checked, ncomp->id * 2);
}
else {
/*