From 3681d040bd87ddbdceccc802ec1d031a7c241d9a Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 30 Apr 2021 17:58:00 +0100 Subject: [PATCH] [Minor] Pet luacheck --- .luacheckrc | 1 + lualib/rspamadm/statistics_dump.lua | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index 7ade0174a..bd6828376 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -36,6 +36,7 @@ globals = { 'rspamadm_dns_resolver', 'jit', 'table.unpack', + 'table.clear', 'unpack', } diff --git a/lualib/rspamadm/statistics_dump.lua b/lualib/rspamadm/statistics_dump.lua index ab4e026c5..7b1dc581e 100644 --- a/lualib/rspamadm/statistics_dump.lua +++ b/lualib/rspamadm/statistics_dump.lua @@ -167,7 +167,7 @@ local function redis_map_zip(ar) end -- Used to clear plain numeric tables -table.clear = table.clear or function(tbl) +local clear_fcn = table.clear or function(tbl) local l = #tbl for i=1,l do tbl[i] = nil end end @@ -248,7 +248,7 @@ local function dump_pattern(conn, pattern, opts, out) -- Do not write the last chunk of out as it will be processed afterwards if not cursor == 0 then dump_out(out, opts, false) - table.clear(out) + clear_fcn(out) end until cursor == 0 -- 2.39.5