diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-10-02 18:52:53 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-10-02 18:52:53 +0100 |
commit | ef337345b5ff8e96cbc7138c0d3cbc0730df2cae (patch) | |
tree | 500827150f3e83a3282e081f8649680fd7511abc /src/libutil/expression.c | |
parent | c4c098a34a1c93c02959fa09ea56798f27ab6d20 (diff) | |
download | rspamd-ef337345b5ff8e96cbc7138c0d3cbc0730df2cae.tar.gz rspamd-ef337345b5ff8e96cbc7138c0d3cbc0730df2cae.zip |
[Minor] Fix evals maths
Diffstat (limited to 'src/libutil/expression.c')
-rw-r--r-- | src/libutil/expression.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libutil/expression.c b/src/libutil/expression.c index 2469d0415..65465ceb6 100644 --- a/src/libutil/expression.c +++ b/src/libutil/expression.c @@ -1098,16 +1098,15 @@ rspamd_process_expression_track (struct rspamd_expression *expr, struct rspamd_e /* Ensure that stack is empty at this point */ g_assert (expr->expression_stack->len == 0); + expr->evals ++; ret = rspamd_ast_process_node (expr, expr->ast, process_data); /* Cleanup */ g_node_traverse (expr->ast, G_IN_ORDER, G_TRAVERSE_ALL, -1, rspamd_ast_cleanup_traverse, NULL); - expr->evals ++; - /* Check if we need to resort */ - if (expr->evals == expr->next_resort) { + if (expr->evals % expr->next_resort == 0) { expr->next_resort = ottery_rand_range (MAX_RESORT_EVALS) + MIN_RESORT_EVALS; /* Set priorities for branches */ |