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/libstat/stat_process.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/libstat/stat_process.c')
-rw-r--r-- | src/libstat/stat_process.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libstat/stat_process.c b/src/libstat/stat_process.c index c07268279..6a1480ec5 100644 --- a/src/libstat/stat_process.c +++ b/src/libstat/stat_process.c @@ -35,14 +35,16 @@ static void rspamd_stat_tokenize_header (struct rspamd_task *task, const gchar *name, const gchar *prefix, GArray *ar) { - struct raw_header *rh, *cur; + struct raw_header *cur; + GPtrArray *hdrs; + guint i; rspamd_ftok_t str; - rh = g_hash_table_lookup (task->raw_headers, name); + hdrs = g_hash_table_lookup (task->raw_headers, name); - if (rh != NULL) { + if (hdrs != NULL) { - LL_FOREACH (rh, cur) { + PTR_ARRAY_FOREACH (hdrs, i, cur) { if (cur->name != NULL) { str.begin = cur->name; str.len = strlen (cur->name); |