diff options
author | HybridDog <ovvv@web.de> | 2016-07-14 12:22:35 +0200 |
---|---|---|
committer | HybridDog <ovvv@web.de> | 2020-10-17 20:50:20 +0200 |
commit | c2fe5fe95668ed34695cf9a0784e34c939148910 (patch) | |
tree | 9fee48112986453c97327fcb2c9c7e338c8d79fd | |
parent | d93396600f25f3f8058a995753ca9277dd9a2ae9 (diff) | |
download | pipeworks-c2fe5fe95668ed34695cf9a0784e34c939148910.tar pipeworks-c2fe5fe95668ed34695cf9a0784e34c939148910.tar.gz pipeworks-c2fe5fe95668ed34695cf9a0784e34c939148910.tar.bz2 pipeworks-c2fe5fe95668ed34695cf9a0784e34c939148910.tar.xz pipeworks-c2fe5fe95668ed34695cf9a0784e34c939148910.zip |
Make pipeworks.table_extend easier to read
In my opinion this clarifies that tbl2 is attached at the end of tbl
-rw-r--r-- | common.lua | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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 |