From e690dd9740835fd0173c7c26beae9cfdbabcd984 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 19 Dec 2015 22:05:13 +0000 Subject: [PATCH] Fix sorting and output of errors_ips --- src/rspamadm/fuzzy_stat.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/rspamadm/fuzzy_stat.lua b/src/rspamadm/fuzzy_stat.lua index 8f430a2d12..92ed9584dd 100644 --- a/src/rspamadm/fuzzy_stat.lua +++ b/src/rspamadm/fuzzy_stat.lua @@ -249,9 +249,11 @@ return function(args, res) if st['errors_ips'] and not opts['no-ips'] and not opts['short'] then print('') print('Errors IPs statistics:') - local sorted_ips = sort_ips(st['errors_ips'], opts) - for i, v in ipairs(sorted_ips) do - print(string.format('%s: %s', v['ip'], print_result(v['data']))) + table.sort(st['errors_ips'], function(a, b) + return a > b + end) + for i, v in pairs(st['errors_ips']) do + print(string.format('%s: %s', i, print_result(v))) end end end -- 2.47.3