Software /
code /
prosody
Diff
core/sessionmanager.lua @ 125:6b6b8f4ab7e3
even faster checking for other sessions... thank you waqas :)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 23 Oct 2008 17:34:10 +0100 |
parent | 124:7fee6b63abca |
child | 126:63863534b1f1 |
line wrap: on
line diff
--- a/core/sessionmanager.lua Thu Oct 23 17:27:41 2008 +0100 +++ b/core/sessionmanager.lua Thu Oct 23 17:34:10 2008 +0100 @@ -39,12 +39,7 @@ if session.resource then hosts[session.host].sessions[session.username].sessions[session.resource] = nil; end - local nomore = true; - for res, ssn in pairs(hosts[session.host].sessions[session.username]) do - nomore = false; - break; - end - if nomore then + if not next(hosts[session.host].sessions[session.username], nil) then hosts[session.host].sessions[session.username] = nil; end end