Bugfixes on CLI interactions

This commit is contained in:
Nathan Schneider committed 2021-12-20 21:28:54 -07:00
1 parent fe2d5fdb2a
commit cfef9b29b0
6 files changed
+40 -19

No files matched your search

+11 -1
View File
@@ -1,9 +1,19 @@
--- @function modpol.copy_table
-- Returns a copy of the table inputted
function modpol.copy_table(t)
function modpol.util.copy_table(t)
local t2 = {}
for k,v in pairs(t) do
t2[k] = v
end
return t2
end
--- @function modpol.copy_table
-- Returns the number of elements in a pairs table
function modpol.util.num_pairs(t)
local i = 0
for k,v in pairs(t) do
i = i + 1
end
return i
end