Make pipeworks.table_extend easier to read

In my opinion this clarifies that tbl2 is attached at the end of tbl
This commit is contained in:
HybridDog 2016-07-14 12:22:35 +02:00
parent d93396600f
commit c2fe5fe956
1 changed files with 3 additions and 4 deletions

View File

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