I need to merge two tables, with the contents of the second overwriting contents in the first if a given item is in both. I looked but the standard libraries don\'t seem to
function merge(t1, t2)
for k, v in pairs(t2) do
if (type(v) == "table") and (type(t1[k] or false) == "table") then
merge(t1[k], t2[k])
else
t1[k] = v
end
end
return t1
end