commit 3681d04: [Minor] Pet luacheck
Vsevolod Stakhov
vsevolod at highsecure.ru
Fri Apr 30 17:00:04 UTC 2021
Author: Vsevolod Stakhov
Date: 2021-04-30 17:58:00 +0100
URL: https://github.com/rspamd/rspamd/commit/3681d040bd87ddbdceccc802ec1d031a7c241d9a (HEAD -> master)
[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
More information about the Commits
mailing list