diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-12-05 13:03:09 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-12-05 13:03:09 +0000 |
commit | ca6f7e1de911f557aea95996ee0de4a5e781d1b7 (patch) | |
tree | 2f9288428d739918015ecc7f84d3c87d4c8b9702 /src/libserver/task.c | |
parent | cd01e044ae181a5dc22c8e7a7dca015bbeb03e55 (diff) | |
download | rspamd-ca6f7e1de911f557aea95996ee0de4a5e781d1b7.tar.gz rspamd-ca6f7e1de911f557aea95996ee0de4a5e781d1b7.zip |
[Rework] Use hash tables for symbols options
Diffstat (limited to 'src/libserver/task.c')
-rw-r--r-- | src/libserver/task.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/libserver/task.c b/src/libserver/task.c index b9fca4d4a..6cf7532fd 100644 --- a/src/libserver/task.c +++ b/src/libserver/task.c @@ -1043,14 +1043,17 @@ rspamd_task_log_metric_res (struct rspamd_task *task, } if (lf->flags & RSPAMD_LOG_FLAG_SYMBOLS_PARAMS) { - GList *cur; + GHashTableIter it; + gpointer k, v; rspamd_printf_fstring (&symbuf, "{"); - j = 0; + g_hash_table_iter_init (&it, sym->options); + + while (g_hash_table_iter_next (&it, &k, &v)) { + const char *opt = v; - for (cur = sym->options; cur != NULL; cur = g_list_next (cur)) { - rspamd_printf_fstring (&symbuf, "%s;", cur->data); + rspamd_printf_fstring (&symbuf, "%s;", opt); if (j >= max_log_elts) { rspamd_printf_fstring (&symbuf, "...;"); |