mirror of
https://github.com/kepler155c/opus
synced 2025-07-07 12:32:52 +00:00
unpack > table.unpack
This commit is contained in:
parent
258a14b9e2
commit
3a0c854bb0
@ -21,7 +21,7 @@ end
|
|||||||
|
|
||||||
function Util.byteArrayToHex(tbl)
|
function Util.byteArrayToHex(tbl)
|
||||||
if not tbl then error('byteArrayToHex: invalid table', 2) end
|
if not tbl then error('byteArrayToHex: invalid table', 2) end
|
||||||
return ("%02x"):rep(#tbl):format(unpack(tbl))
|
return ("%02x"):rep(#tbl):format(table.unpack(tbl))
|
||||||
end
|
end
|
||||||
|
|
||||||
function Util.tryTimed(timeout, f, ...)
|
function Util.tryTimed(timeout, f, ...)
|
||||||
@ -39,10 +39,10 @@ function Util.tryTimes(attempts, f, ...)
|
|||||||
for _ = 1, attempts do
|
for _ = 1, attempts do
|
||||||
result = { f(...) }
|
result = { f(...) }
|
||||||
if result[1] then
|
if result[1] then
|
||||||
return unpack(result)
|
return table.unpack(result)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return unpack(result)
|
return table.unpack(result)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Util.timer()
|
function Util.timer()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user