diff options
Diffstat (limited to '')
-rw-r--r-- | apt-panopticommon.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/apt-panopticommon.lua b/apt-panopticommon.lua index b1f39d7..8a18c4b 100644 --- a/apt-panopticommon.lua +++ b/apt-panopticommon.lua | |||
@@ -334,6 +334,20 @@ dumpTableSub = function (table, space) | |||
334 | return r | 334 | return r |
335 | end | 335 | end |
336 | 336 | ||
337 | |||
338 | APT.allpairs = function(tbl, func) | ||
339 | for k, v in pairs(tbl) do | ||
340 | if 'table' == type(v) then | ||
341 | for i, w in pairs(v) do | ||
342 | func(i, w, k, v) | ||
343 | end | ||
344 | else | ||
345 | func(k, v) | ||
346 | end | ||
347 | end | ||
348 | end | ||
349 | |||
350 | |||
337 | APT.search = function(t, s) | 351 | APT.search = function(t, s) |
338 | for i, v in pairs(t) do | 352 | for i, v in pairs(t) do |
339 | if v == s then return true end | 353 | if v == s then return true end |