From 00278f7258113d5520c7ff85345e7243a9ebc838 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 28 Dec 2018 21:12:19 +0000 Subject: remove silly double locking --- .../Region/Framework/Scenes/SceneObjectGroup.cs | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index a78ed8b..9c3f166 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -5468,15 +5468,19 @@ namespace OpenSim.Region.Framework.Scenes // this scales bad but so does GetLinkNumPart public int GetLinkNumber(string name) { - if(String.IsNullOrEmpty(name) || name == "Object") + if(String.IsNullOrEmpty(name) || name == "Object" || name == "Primitive") return -1; lock(m_partsNameToLinkMap) { - if(m_partsNameToLinkMap.Count == 0) + if (name == GetLinkNumber_lastname) + return GetLinkNumber_lastnumber; + + if (m_partsNameToLinkMap.Count == 0) { GetLinkNumber_lastname = String.Empty; GetLinkNumber_lastnumber = -1; + SceneObjectPart[] parts = m_parts.GetArray(); for (int i = 0; i < parts.Length; i++) { @@ -5495,19 +5499,13 @@ namespace OpenSim.Region.Framework.Scenes } } - if(name == GetLinkNumber_lastname) - return GetLinkNumber_lastnumber; - if(m_partsNameToLinkMap.ContainsKey(name)) { - lock(m_partsNameToLinkMap) - { - GetLinkNumber_lastname = name; - GetLinkNumber_lastnumber = m_partsNameToLinkMap[name]; - return GetLinkNumber_lastnumber; - } + GetLinkNumber_lastname = name; + GetLinkNumber_lastnumber = m_partsNameToLinkMap[name]; + return GetLinkNumber_lastnumber; } - } + } if(m_sittingAvatars.Count > 0) { -- cgit v1.1