aboutsummaryrefslogtreecommitdiffstats
path: root/core/sessionmanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2008-10-23 17:34:10 +0100
committerMatthew Wild <mwild1@gmail.com>2008-10-23 17:34:10 +0100
commit3286f0609f034a3b9814a3d7df4151008554f992 (patch)
tree77675aa35dd4d04f2b3ab23976e75bf527c0ffac /core/sessionmanager.lua
parent9e6c3919af199834aa3f5abb2d7988d38e6f09ed (diff)
downloadprosody-3286f0609f034a3b9814a3d7df4151008554f992.tar.gz
prosody-3286f0609f034a3b9814a3d7df4151008554f992.zip
even faster checking for other sessions... thank you waqas :)
Diffstat (limited to 'core/sessionmanager.lua')
-rw-r--r--core/sessionmanager.lua7
1 files changed, 1 insertions, 6 deletions
diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua
index a4fb8a87..19614311 100644
--- a/core/sessionmanager.lua
+++ b/core/sessionmanager.lua
@@ -39,12 +39,7 @@ function destroy_session(session)
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