Timed entry removal working again

This commit is contained in:
Santos 2012-10-28 23:37:35 +11:00
parent 8dd3dae68b
commit 8514896b9c

View File

@ -79,12 +79,8 @@ end
function cron.update(dt)
assert(type(dt) == "number" and dt >= 0, "dt must be a non-negative number")
local expired = {}
for id, entry in pairs(entries) do
if entry:update(dt) then expired[id] = true end
end
for id,_ in pairs(expired) do
entries[id] = nil
if entry:update(dt) then entries[id] = nil end
end
end