Template
1
0
mirror of https://github.com/bol-van/zapret2.git synced 2026-03-20 00:05:48 +00:00
This commit is contained in:
bol-van
2026-02-08 17:12:36 +03:00
parent 8f316ae1a2
commit 0917cb21bb
3 changed files with 14 additions and 12 deletions

View File

@@ -321,22 +321,24 @@ end
-- convert array a to packed string using 'packer' function. only numeric indexes starting from 1, order preserved
function barray(a, packer)
local sa={}
if a then
local s=""
for i=1,#a do
s = s .. packer(a[i])
sa[i] = packer(a[i])
end
return s
return table.concat(sa)
end
end
-- convert table a to packed string using 'packer' function. any indexes, any order
function btable(a, packer)
local sa={}
if a then
local s=""
for k,v in pairs(a) do
s = s .. packer(v)
sa[k] = packer(v)
end
return s
return table.concat(sa)
end
end