From 3286f0609f034a3b9814a3d7df4151008554f992 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Thu, 23 Oct 2008 17:34:10 +0100 Subject: even faster checking for other sessions... thank you waqas :) --- core/sessionmanager.lua | 7 +------ 1 file changed, 1 insertion(+), 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 -- cgit v1.2.3