Jump to content

Module:TableTools: Difference between revisions

check for existing values in p.union value arrays
m>Mr. Stradivarius
(remove a variable that I didn't use in the end)
m>Mr. Stradivarius
(check for existing values in p.union value arrays)
Line 56: Line 56:
if trackArrays[k] then
if trackArrays[k] then
local array = ret[k]
local array = ret[k]
array[#array + 1] = v
local valExists
ret[k] = array
for _, arrayVal in ipairs(array) do
if arrayVal == v then
valExists = true
end
end
if not valExists then
array[#array + 1] = v
ret[k] = array
end
else
else
ret[k] = {ret[k], v}
ret[k] = {ret[k], v}
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.