aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-03-27 14:14:47 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-03-27 14:14:47 +0000
commit7476eadbf9642b0044f27f4bdabd7ec5df107a47 (patch)
tree0293bd9cb622cbf9d1f2aceb121c0c5231dc3253 /src
parent31e833390fc240a3a76db465485c1477c0c0f9d3 (diff)
downloadrspamd-7476eadbf9642b0044f27f4bdabd7ec5df107a47.tar.gz
rspamd-7476eadbf9642b0044f27f4bdabd7ec5df107a47.zip
Optimize expressions earlier.
Diffstat (limited to 'src')
-rw-r--r--src/libutil/expression.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/libutil/expression.c b/src/libutil/expression.c
index ed52226ee..8696c1cc6 100644
--- a/src/libutil/expression.c
+++ b/src/libutil/expression.c
@@ -848,16 +848,15 @@ rspamd_ast_process_node (struct rspamd_expression *expr, GNode *node,
/* Save limit if we've found it */
val = rspamd_ast_process_node (expr, cld, data);
- if (acc != G_MININT || cld->next == NULL) {
- acc = rspamd_ast_do_op (elt, val, acc);
-
- if (rspamd_ast_node_done (elt, parelt, acc, lim)) {
- return acc;
- }
- }
- else {
+ if (acc == G_MININT) {
acc = val;
}
+
+ acc = rspamd_ast_do_op (elt, val, acc);
+
+ if (rspamd_ast_node_done (elt, parelt, acc, lim)) {
+ return acc;
+ }
}
break;
}