mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Fixes field 'empty' is not callable (a nil value)
Partially addresses #5965
This commit is contained in:
parent
913d39c159
commit
5502f3fc2e
3 changed files with 28 additions and 23 deletions
|
|
@ -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
|
||||
-- ############################################
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue