Fixes field 'empty' is not callable (a nil value)

Partially addresses #5965
This commit is contained in:
Simone Mainardi 2021-10-11 15:34:40 +02:00
parent 913d39c159
commit 5502f3fc2e
3 changed files with 28 additions and 23 deletions

View file

@ -2549,29 +2549,6 @@ function hostinfo2jqueryid(host_info,host_type)
return rsp
end
-- NOTE: on index based tables using #table is much more performant
function table.len(table)
local count = 0
if(table == nil) then return(0) end
for k,v in pairs(table) do
count = count + 1
end
return count
end
function table.slice(tbl, first, last, step)
local sliced = {}
for i = first or 1, last or #tbl, step or 1 do
sliced[#sliced+1] = tbl[i]
end
return sliced
end
-- ############################################
-- Redis Utils
-- ############################################