Module:TableTools: Difference between revisions
From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
Content added Content deleted
(add getUnion function) |
(better variable name - getUnion deals with all tables, not just arrays) |
||
Line 43: | Line 43: | ||
--]] |
--]] |
||
function p.getUnion(...) |
function p.getUnion(...) |
||
local |
local tables = {...} |
||
local vals, ret = {}, {} |
local vals, ret = {}, {} |
||
for _, t in ipairs( |
for _, t in ipairs(tables) do |
||
for k, v in pairs(t) do |
for k, v in pairs(t) do |
||
vals[v] = true |
vals[v] = true |