Difference between revisions of "Module:TableTools"

Jump to navigation Jump to search
No change in size ,  13:31, 15 December 2013
better variable name - getUnion deals with all tables, not just arrays
>Mr. Stradivarius
(add getUnion function)
>Mr. Stradivarius
(better variable name - getUnion deals with all tables, not just arrays)
Line 43: Line 43:
--]]
--]]
function p.getUnion(...)
function p.getUnion(...)
local arrays = {...}
local tables = {...}
local vals, ret = {}, {}
local vals, ret = {}, {}
for _, t in ipairs(arrays) do
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
Anonymous user

Navigation menu