even faster checking for other sessions... thank you waqas :)

Thu, 23 Oct 2008 17:34:10 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 23 Oct 2008 17:34:10 +0100
changeset 125
6b6b8f4ab7e3
parent 124
7fee6b63abca
child 126
63863534b1f1
child 135
bf10d42dd41b

even faster checking for other sessions... thank you waqas :)

core/sessionmanager.lua file | annotate | diff | comparison | revisions
--- 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

mercurial