diff options
author | Kim Alvefur <zash@zash.se> | 2016-08-23 20:01:02 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-08-23 20:01:02 +0200 |
commit | 03d11415030b1f36e80b06a00ab7b0d4117992df (patch) | |
tree | 579aa3402aa078ad4e1800c4896db7fd9a6376c7 /net | |
parent | dd497da7c4c36414c53858ebc204b3fa67ff4fb1 (diff) | |
download | prosody-03d11415030b1f36e80b06a00ab7b0d4117992df.tar.gz prosody-03d11415030b1f36e80b06a00ab7b0d4117992df.zip |
net.server_epoll: Return early in the event of zero timers
Diffstat (limited to 'net')
-rw-r--r-- | net/server_epoll.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua index a6d97500..afc3f551 100644 --- a/net/server_epoll.lua +++ b/net/server_epoll.lua @@ -65,6 +65,11 @@ end -- Run callbacks of expired timers -- Return time until next timeout local function runtimers(next_delay) + -- Any timers at all? + if not timers[1] then + return next_delay; + end + if resort_timers then -- Sort earliest timers to the end t_sort(timers, function (a, b) return a[1] > b[1]; end); |