mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
add check for table contains
This commit is contained in:
parent
95248e7424
commit
d2babc3d24
1 changed files with 1 additions and 0 deletions
|
|
@ -3944,6 +3944,7 @@ function table.contains(t, needle, comp)
|
|||
|
||||
if (t == nil) then return false end
|
||||
if (type(t) ~= "table") then return false end
|
||||
if (#t == 0) then return false end
|
||||
|
||||
local default_compare = (function(e) return e == needle end)
|
||||
comp = comp or default_compare
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue