aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-06-29 20:13:12 +0200
committerKim Alvefur <zash@zash.se>2020-06-29 20:13:12 +0200
commit2b81c3b50f78236db6cf91d80eaee161de384dc9 (patch)
tree09eff814a8afc22441328c59e11909301ae33261
parentee10afcfabfce801deb7b07882674264f3892390 (diff)
downloadprosody-2b81c3b50f78236db6cf91d80eaee161de384dc9.tar.gz
prosody-2b81c3b50f78236db6cf91d80eaee161de384dc9.zip
net.server_epoll: Remove unused time field from timer objects
Unused since the move to util.indexedbheap in c8c3f2eba898
-rw-r--r--net/server_epoll.lua9
1 files changed, 3 insertions, 6 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index b7a11e8b..f65be224 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -87,21 +87,19 @@ local timers = indexedbheap.create();
local function noop() end
local function closetimer(t)
- t[1] = 0;
- t[2] = noop;
+ t[1] = noop;
timers:remove(t.id);
end
local function reschedule(t, time)
time = monotonic() + time;
- t[1] = time;
timers:reprioritize(t.id, time);
end
-- Add relative timer
local function addtimer(timeout, f, param)
local time = monotonic() + timeout;
- local timer = { time, f, param, close = closetimer, reschedule = reschedule, id = nil };
+ local timer = { f, param, close = closetimer, reschedule = reschedule, id = nil };
timer.id = timers:insert(timer, time);
return timer;
end
@@ -121,10 +119,9 @@ local function runtimers(next_delay, min_wait)
end
local _, timer = timers:pop();
- local ok, ret = pcall(timer[2], now, timer, timer[3]);
+ local ok, ret = pcall(timer[1], now, timer, timer[2]);
if ok and type(ret) == "number" then
local next_time = elapsed+ret;
- timer[1] = next_time;
timers:insert(timer, next_time);
end