diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-09-05 23:34:43 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-09-05 23:34:43 +0100 |
commit | e540a3db85f394c4ab3b53e100be9353b4027066 (patch) | |
tree | 5ffb7871e81f495de86ce205330b702c7bfddbd9 /src/controller.c | |
parent | 8238c289e0551a3c3d4344948bd7bda173f2cce4 (diff) | |
download | rspamd-e540a3db85f394c4ab3b53e100be9353b4027066.tar.gz rspamd-e540a3db85f394c4ab3b53e100be9353b4027066.zip |
[Minor] Declare variable where it is used
Diffstat (limited to 'src/controller.c')
-rw-r--r-- | src/controller.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/controller.c b/src/controller.c index adebce251..28677a906 100644 --- a/src/controller.c +++ b/src/controller.c @@ -2580,7 +2580,6 @@ rspamd_controller_stat_fin_task (void *ud) struct rspamd_stat_cbdata *cbdata = ud; struct rspamd_http_connection_entry *conn_ent; ucl_object_t *top, *ar; - GList *fuzzy_elts, *cur; struct rspamd_fuzzy_stat_entry *entry; conn_ent = cbdata->conn_ent; @@ -2593,12 +2592,12 @@ rspamd_controller_stat_fin_task (void *ud) ucl_object_insert_key (top, cbdata->stat, "statfiles", 0, false); } - fuzzy_elts = rspamd_mempool_get_variable (cbdata->task->task_pool, "fuzzy_stat"); + GList *fuzzy_elts = rspamd_mempool_get_variable (cbdata->task->task_pool, "fuzzy_stat"); if (fuzzy_elts) { ar = ucl_object_typed_new (UCL_OBJECT); - for (cur = fuzzy_elts; cur != NULL; cur = g_list_next (cur)) { + for (GList *cur = fuzzy_elts; cur != NULL; cur = g_list_next (cur)) { entry = cur->data; if (entry->name) { @@ -2821,7 +2820,6 @@ rspamd_controller_metrics_fin_task (void *ud) { struct rspamd_stat_cbdata *cbdata = ud; struct rspamd_http_connection_entry *conn_ent; ucl_object_t *top; - GList *fuzzy_elts, *cur; struct rspamd_fuzzy_stat_entry *entry; rspamd_fstring_t *output; gint i; @@ -3048,12 +3046,12 @@ rspamd_controller_metrics_fin_task (void *ud) { rspamd_fstring_free (users); } - fuzzy_elts = rspamd_mempool_get_variable (cbdata->task->task_pool, "fuzzy_stat"); + GList *fuzzy_elts = rspamd_mempool_get_variable (cbdata->task->task_pool, "fuzzy_stat"); if (fuzzy_elts) { rspamd_printf_fstring (&output, "# HELP rspamd_fuzzy_stat Fuzzy stat labelled by storage.\n"); rspamd_printf_fstring (&output, "# TYPE rspamd_fuzzy_stat gauge\n"); - for (cur = fuzzy_elts; cur != NULL; cur = g_list_next (cur)) { + for (GList *cur = fuzzy_elts; cur != NULL; cur = g_list_next (cur)) { entry = cur->data; if (entry->name) { |