VE Lua Documentation

Press F to search!

setUnion

Definition


-- @/lua/common/utils.lua:517

-- appends to dst array, all the values from src array that didn't exist in dst array
function setUnion(dst, src)
  local lut = tableValuesAsLookupDict(dst)
  for _,v in ipairs(src) do
    if not lut[v] then
      table.insert(dst, v)
      lut[v] = 1
    end
  end
  return dst
end

Callers