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

'rspamadm_dns_resolver', 'rspamadm_dns_resolver',
'jit', 'jit',
'table.unpack', 'table.unpack',
'table.clear',
'unpack', 'unpack',
} }



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

end end


-- Used to clear plain numeric tables -- Used to clear plain numeric tables
table.clear = table.clear or function(tbl)
local clear_fcn = table.clear or function(tbl)
local l = #tbl local l = #tbl
for i=1,l do tbl[i] = nil end for i=1,l do tbl[i] = nil end
end end
-- Do not write the last chunk of out as it will be processed afterwards -- Do not write the last chunk of out as it will be processed afterwards
if not cursor == 0 then if not cursor == 0 then
dump_out(out, opts, false) dump_out(out, opts, false)
table.clear(out)
clear_fcn(out)
end end


until cursor == 0 until cursor == 0

Loading…
Cancel
Save