From 388c08c712c8279a52ad82caa213191352639ca9 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 28 Sep 2016 14:30:13 +0100 Subject: [Feature] Stop using of GLists for headers, improve performance --- src/libmime/mime_expressions.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/libmime/mime_expressions.c') diff --git a/src/libmime/mime_expressions.c b/src/libmime/mime_expressions.c index bdf5644fd..4fd1a893c 100644 --- a/src/libmime/mime_expressions.c +++ b/src/libmime/mime_expressions.c @@ -1012,7 +1012,7 @@ gboolean rspamd_header_exists (struct rspamd_task * task, GArray * args, void *unused) { struct expression_argument *arg; - GList *headerlist; + GPtrArray *headerlist; if (args == NULL || task == NULL) { return FALSE; @@ -1025,12 +1025,14 @@ rspamd_header_exists (struct rspamd_task * task, GArray * args, void *unused) } debug_task ("try to get header %s", (gchar *)arg->data); - headerlist = rspamd_message_get_header (task, + headerlist = rspamd_message_get_header_array (task, (gchar *)arg->data, FALSE); + if (headerlist) { return TRUE; } + return FALSE; } -- cgit v1.2.3