Browse Source

[Minor] Pet luacheck

tags/3.0
Vsevolod Stakhov 3 years ago
parent
commit
3681d040bd
2 changed files with 3 additions and 2 deletions
  1. 1
    0
      .luacheckrc
  2. 2
    2
      lualib/rspamadm/statistics_dump.lua

+ 1
- 0
.luacheckrc View File

@@ -36,6 +36,7 @@ globals = {
'rspamadm_dns_resolver',
'jit',
'table.unpack',
'table.clear',
'unpack',
}


+ 2
- 2
lualib/rspamadm/statistics_dump.lua View File

@@ -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

Loading…
Cancel
Save