Merge branch 'm_table_extends_clean' into 'master'

Make pipeworks.table_extend easier to read

See merge request VanessaE/pipeworks!29
This commit is contained in:
Vanessa Dannenberg 2020-10-17 18:55:01 +00:00
commit d814357ddf
1 changed files with 3 additions and 4 deletions

View File

@ -86,10 +86,9 @@ function pipeworks.table_contains(tbl, element)
end
function pipeworks.table_extend(tbl, tbl2)
local index = #tbl + 1
for _, elt in ipairs(tbl2) do
tbl[index] = elt
index = index + 1
local oldlength = #tbl
for i = 1,#tbl2 do
tbl[oldlength + i] = tbl2[i]
end
end