]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Improve readability of recently changed rspamc code 3901/head
authorAnton Yuzhaninov <citrin+git@citrin.ru>
Tue, 21 Sep 2021 10:14:10 +0000 (11:14 +0100)
committerAnton Yuzhaninov <citrin+git@citrin.ru>
Tue, 21 Sep 2021 10:14:10 +0000 (11:14 +0100)
src/client/rspamc.c

index 869a82b03e5e8a24cca5a868c3b5f185302e4f49..4bb6321215acc998cda4e3ec26771ef0031e5bc1 100644 (file)
@@ -1035,8 +1035,6 @@ rspamc_counters_output (FILE *out, ucl_object_t *obj)
        const ucl_object_t *cur, *sym, *weight, *freq, *freq_dev, *nhits;
        ucl_object_iter_t iter = NULL;
        gchar fmt_buf[64], dash_buf[82], sym_buf[82];
-       gint l, i;
-       gint max_len = sizeof("Symbol") - 1;
        static const gint dashes = 44;
 
        if (obj->type != UCL_ARRAY) {
@@ -1050,12 +1048,12 @@ rspamc_counters_output (FILE *out, ucl_object_t *obj)
        }
 
        /* Find maximum width of symbol's name */
+       gint max_len = sizeof("Symbol") - 1;
        while ((cur = ucl_object_iterate (obj, &iter, true)) != NULL) {
                sym = ucl_object_lookup (cur, "symbol");
                if (sym != NULL) {
-                       l = sym->len;
-                       if (l > max_len) {
-                               max_len = l;
+                       if (sym->len > max_len) {
+                               max_len = sym->len;
                        }
                }
        }
@@ -1081,7 +1079,7 @@ rspamc_counters_output (FILE *out, ucl_object_t *obj)
                "| %%3d | %%%ds | %%7.1f | %%6.3f(%%5.3f) | %%7ju |\n", max_len);
 
        iter = NULL;
-       i = 0;
+       gint i = 0;
        while ((cur = ucl_object_iterate (obj, &iter, true)) != NULL) {
                printf (" %s \n", dash_buf);
                sym = ucl_object_lookup (cur, "symbol");