From: Jo-Philipp Wich Date: Sat, 18 Jul 2009 21:55:14 +0000 (+0000) Subject: libs/nixio: add destination table argument to nixio.util.consume() X-Git-Tag: 0.10.0~1335 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4bc6b85bb7d1932c5d3df84b7fefeaecbffd213c;p=oweals%2Fluci.git libs/nixio: add destination table argument to nixio.util.consume() --- diff --git a/libs/nixio/lua/nixio/util.lua b/libs/nixio/lua/nixio/util.lua index 0e8c90c9a..d83209aff 100644 --- a/libs/nixio/lua/nixio/util.lua +++ b/libs/nixio/lua/nixio/util.lua @@ -26,8 +26,8 @@ local file = nixio.meta_file local uname = nixio.uname() local ZBUG = uname.sysname == "Linux" and uname.release:sub(1, 3) == "2.4" -function consume(iter) - local tbl = {} +function consume(iter, append) + local tbl = append or {} for obj in iter do tbl[#tbl+1] = obj end @@ -259,4 +259,4 @@ for k, v in pairs(meta) do file[k] = v socket[k] = v tls_socket[k] = v -end \ No newline at end of file +end