diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-10-08 19:21:20 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-10-08 19:21:20 +0100 |
commit | 2e2c66f6be03c03de7696918cc222047c70e9747 (patch) | |
tree | a71b5d69de012b83ac9eb87ffa9d00dd08917801 | |
parent | a10819e96987b1082fc503fa4a07409fc7ea31f2 (diff) | |
download | rspamd-2e2c66f6be03c03de7696918cc222047c70e9747.tar.gz rspamd-2e2c66f6be03c03de7696918cc222047c70e9747.zip |
[Minor] Slightly optimize hash lookup
-rw-r--r-- | src/libserver/composites.c | 6 |
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 { /* |