mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-21 03:40:49 +00:00
api: avoid garbage table creation on QueueFunction
This commit is contained in:
+2
-7
@@ -339,13 +339,8 @@ function pfUI.api.QueueFunction(...)
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
assert(type(arg[1])=="function","QueueFunction: arg1 is not a function")
|
assert(type(arg[1])=="function","QueueFunction: arg1 is not a function")
|
||||||
local func = arg[1]
|
local func = table.remove(arg, 1)
|
||||||
local args
|
table.insert(timer.queue,{func,arg})
|
||||||
for i=2,arg.n do
|
|
||||||
args = args or {}
|
|
||||||
table.insert(args,arg[i])
|
|
||||||
end
|
|
||||||
table.insert(timer.queue,{func,args})
|
|
||||||
timer:Show() -- start the OnUpdate
|
timer:Show() -- start the OnUpdate
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user