mirror of
https://github.com/mt-mods/pipeworks.git
synced 2024-11-17 15:58:29 +01:00
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:
parent
d93396600f
commit
c2fe5fe956
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user