diff options
author | John Hurliman | 2009-10-23 01:02:36 -0700 |
---|---|---|
committer | John Hurliman | 2009-10-23 01:02:36 -0700 |
commit | 588361e2a2398b963871762c2b5485c6a086cf47 (patch) | |
tree | 5be2c6705096817c599075da4e12a0e9b0a4c841 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |
parent | Added VS2010 support to Prebuild and created runprebuild2010.bat (diff) | |
download | opensim-SC-588361e2a2398b963871762c2b5485c6a086cf47.zip opensim-SC-588361e2a2398b963871762c2b5485c6a086cf47.tar.gz opensim-SC-588361e2a2398b963871762c2b5485c6a086cf47.tar.bz2 opensim-SC-588361e2a2398b963871762c2b5485c6a086cf47.tar.xz |
Experimental change to use an immutable array for iterating ScenePresences, avoiding locking and copying the list each time it is accessed
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 669189d..56d4d28 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -7227,13 +7227,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7227 | public LSL_Integer llGetNumberOfPrims() | 7227 | public LSL_Integer llGetNumberOfPrims() |
7228 | { | 7228 | { |
7229 | m_host.AddScriptLPS(1); | 7229 | m_host.AddScriptLPS(1); |
7230 | List<ScenePresence> presences = World.GetScenePresences(); | 7230 | ScenePresence[] presences = World.GetScenePresences(); |
7231 | if (presences.Count == 0) | 7231 | if (presences.Length == 0) |
7232 | return 0; | 7232 | return 0; |
7233 | 7233 | ||
7234 | int avatarCount = 0; | 7234 | int avatarCount = 0; |
7235 | foreach (ScenePresence presence in presences) | 7235 | for (int i = 0; i < presences.Length; i++) |
7236 | { | 7236 | { |
7237 | ScenePresence presence = presences[i]; | ||
7238 | |||
7237 | if (!presence.IsChildAgent && presence.ParentID != 0) | 7239 | if (!presence.IsChildAgent && presence.ParentID != 0) |
7238 | { | 7240 | { |
7239 | if (m_host.ParentGroup.HasChildPrim(presence.ParentID)) | 7241 | if (m_host.ParentGroup.HasChildPrim(presence.ParentID)) |