From: Vsevolod Stakhov Date: Thu, 4 Jun 2015 17:19:10 +0000 (+0100) Subject: Fix symbols items loading. X-Git-Tag: 1.0.0~575 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=acfa259ac6d130415a9c1c578ca3f6e17b595009;p=rspamd.git Fix symbols items loading. --- diff --git a/src/libserver/symbols_cache.c b/src/libserver/symbols_cache.c index 8d5ec0f3c..db0704e93 100644 --- a/src/libserver/symbols_cache.c +++ b/src/libserver/symbols_cache.c @@ -265,30 +265,30 @@ rspamd_symbols_cache_load_items (struct symbols_cache *cache, const gchar *name) if (elt) { item->frequency = ucl_object_toint (elt); } - } - } - if (item->type == SYMBOL_TYPE_VIRTUAL && item->parent != -1) { - g_assert (item->parent < (gint)cache->items_by_order->len); - parent = g_ptr_array_index (cache->items_by_order, item->parent); + if (item->type == SYMBOL_TYPE_VIRTUAL && item->parent != -1) { + g_assert (item->parent < (gint)cache->items_by_order->len); + parent = g_ptr_array_index (cache->items_by_order, item->parent); - if (parent->weight < item->weight) { - parent->weight = item->weight; - } + if (parent->weight < item->weight) { + parent->weight = item->weight; + } - /* - * We maintain avg_time for virtual symbols equal to the - * parent item avg_time - */ - parent->avg_time = item->avg_time; - parent->avg_counter = item->avg_counter; - } + /* + * We maintain avg_time for virtual symbols equal to the + * parent item avg_time + */ + parent->avg_time = item->avg_time; + parent->avg_counter = item->avg_counter; + } - if (abs (item->weight) > cache->max_weight) { - cache->max_weight = abs (item->weight); - } + if (abs (item->weight) > cache->max_weight) { + cache->max_weight = abs (item->weight); + } - cache->total_freq += item->frequency; + cache->total_freq += item->frequency; + } + } ucl_object_iterate_free (it); ucl_object_unref (top);