diff --git a/cron.lua b/cron.lua index 2d70440..0cc7582 100644 --- a/cron.lua +++ b/cron.lua @@ -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