aboutsummaryrefslogtreecommitdiffstats
path: root/net/server_event.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-09-25 18:07:08 +0200
committerKim Alvefur <zash@zash.se>2015-09-25 18:07:08 +0200
commit356975370c97c43a3a0f3bb935ad027607d343cb (patch)
tree1497899ee225f6d90489141d451aed48617f94a2 /net/server_event.lua
parent82e11141e9c48be266f0de78192fdc050e9ed28d (diff)
downloadprosody-356975370c97c43a3a0f3bb935ad027607d343cb.tar.gz
prosody-356975370c97c43a3a0f3bb935ad027607d343cb.zip
server_event: Remove needless scoping around add_task
Diffstat (limited to 'net/server_event.lua')
-rw-r--r--net/server_event.lua22
1 files changed, 9 insertions, 13 deletions
diff --git a/net/server_event.lua b/net/server_event.lua
index c0cc8467..34cda026 100644
--- a/net/server_event.lua
+++ b/net/server_event.lua
@@ -796,21 +796,17 @@ local function link(sender, receiver, buffersize)
sender:set_mode("*a");
end
-local add_task do
- local EVENT_LEAVE = (event.core and event.core.LEAVE) or -1;
- local socket_gettime = socket.gettime
- function add_task(delay, callback)
- local event_handle;
- event_handle = base:addevent(nil, 0, function ()
- local ret = callback(socket_gettime());
- if ret then
- return 0, ret;
- elseif event_handle then
- return EVENT_LEAVE;
- end
+local function add_task(delay, callback)
+ local event_handle;
+ event_handle = base:addevent(nil, 0, function ()
+ local ret = callback(socket_gettime());
+ if ret then
+ return 0, ret;
+ elseif event_handle then
+ return -1;
end
- , delay);
end
+ , delay);
end
return {