Got first token modules working, and a bunch of bugfixes throughout
This commit is contained in:
@ -1,11 +1,18 @@
|
||||
modpol.util = {}
|
||||
|
||||
--- @function modpol.copy_table
|
||||
-- @param t table
|
||||
-- Returns a copy of the table inputted
|
||||
function modpol.util.copy_table(t)
|
||||
local t2 = {}
|
||||
for k,v in pairs(t) do
|
||||
t2[k] = v
|
||||
if ipairs(t) then
|
||||
for i,v in ipairs(t) do
|
||||
t2[i] = v
|
||||
end
|
||||
elseif pairs(t) then
|
||||
for k,v in pairs(t) do
|
||||
t2[k] = v
|
||||
end
|
||||
end
|
||||
return t2
|
||||
end
|
||||
|
Reference in New Issue
Block a user