diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-09-28 14:30:13 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-09-28 14:30:13 +0100 |
commit | 388c08c712c8279a52ad82caa213191352639ca9 (patch) | |
tree | 9f12bba4be9b9772044928949c920175fa89d072 /src/libserver/re_cache.c | |
parent | 61dbbe0eca5291b1329393a5fe1903fde415a243 (diff) | |
download | rspamd-388c08c712c8279a52ad82caa213191352639ca9.tar.gz rspamd-388c08c712c8279a52ad82caa213191352639ca9.zip |
[Feature] Stop using of GLists for headers, improve performance
Diffstat (limited to 'src/libserver/re_cache.c')
-rw-r--r-- | src/libserver/re_cache.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libserver/re_cache.c b/src/libserver/re_cache.c index c2ade15c5..955aa91e0 100644 --- a/src/libserver/re_cache.c +++ b/src/libserver/re_cache.c @@ -742,7 +742,6 @@ rspamd_re_cache_exec_re (struct rspamd_task *task, { guint ret = 0, i, re_id; GPtrArray *headerlist; - GList *slist; GHashTableIter it; struct raw_header *rh; const gchar *in, *end; @@ -966,10 +965,10 @@ rspamd_re_cache_exec_re (struct rspamd_task *task, * of the body content. */ - slist = rspamd_message_get_header (task, "Subject", FALSE); + headerlist = rspamd_message_get_header_array (task, "Subject", FALSE); - if (slist) { - rh = slist->data; + if (headerlist && headerlist->len > 0) { + rh = g_ptr_array_index (headerlist, 0); scvec[0] = (guchar *)rh->decoded; lenvec[0] = strlen (rh->decoded); |