Since there is no practical difference between a filter with one query and a
filter with multiple queries using the same context pointer, we can extend
the existing queries as long as there is a context pointer match. This
reduces the number of queries (and filter expressions) thereby increasing
future optimization opportunities.
/* success - non-NULL expression */
i_assert(state.error == NULL);
- int_query = array_append_space(&filter->queries);
- int_query->context = NULL;
- int_query->expr = state.output;
+ int_query = event_filter_get_or_alloc_internal_query(filter, NULL);
+
+ add_node(filter->pool, &int_query->expr, state.output,
+ EVENT_FILTER_OP_OR);
filter->named_queries_only = filter->named_queries_only && state.has_event_name;
} else if (ret != 0) {