# HG changeset patch # User Kim Alvefur # Date 1442585315 -7200 # Node ID 9f45f0fe5aef96ace49110e8db05aba04bc0802b # Parent 3afb8aa780690714ad85ce13f4b5fd82e282923b util.timer: Fix indentation diff -r 3afb8aa78069 -r 9f45f0fe5aef util/timer.lua --- a/util/timer.lua Thu Sep 17 22:15:26 2015 +0200 +++ b/util/timer.lua Fri Sep 18 16:08:35 2015 +0200 @@ -40,15 +40,15 @@ if success and type(err) == "number" then h:insert(_callback, err + now, _id); -- re-add params[_id] = _param; - end end + end next_time = peek; if peek ~= nil then return peek - now; end end local function add_task(delay, callback, param) - local current_time = get_time(); + local current_time = get_time(); local event_time = current_time + delay; local id = h:insert(callback, event_time); @@ -56,13 +56,13 @@ if next_time == nil or event_time < next_time then next_time = event_time; _add_task(next_time - current_time, _on_timer); - end + end return id; - end +end local function stop(id) params[id] = nil; return h:remove(id); - end +end local function reschedule(id, delay) local current_time = get_time(); local event_time = current_time + delay; @@ -70,7 +70,7 @@ if next_time == nil or event_time < next_time then next_time = event_time; _add_task(next_time - current_time, _on_timer); - end + end return id; end