This commit is contained in:
kikito 2012-10-28 16:48:19 +01:00
commit b855d79bb9

View File

@ -84,12 +84,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