From 588361e2a2398b963871762c2b5485c6a086cf47 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Fri, 23 Oct 2009 01:02:36 -0700 Subject: Experimental change to use an immutable array for iterating ScenePresences, avoiding locking and copying the list each time it is accessed --- OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/CoreModules/World/Estate') diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 3bb162e..e3a395e 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs @@ -414,9 +414,12 @@ namespace OpenSim.Region.CoreModules.World.Estate private void handleEstateTeleportAllUsersHomeRequest(IClientAPI remover_client, UUID invoice, UUID senderID) { // Get a fresh list that will not change as people get teleported away - List prescences = m_scene.GetScenePresences(); - foreach (ScenePresence p in prescences) + ScenePresence[] presences = m_scene.GetScenePresences(); + + for (int i = 0; i < presences.Length; i++) { + ScenePresence p = presences[i]; + if (p.UUID != senderID) { // make sure they are still there, we could be working down a long list -- cgit v1.1