From 8e3dd64282495e8f7b18efcb2a2e57218a3db6ad Mon Sep 17 00:00:00 2001 From: James J Greensky Date: Wed, 30 Sep 2009 16:52:59 -0700 Subject: Removed an innefficent List.Contains lookup from UpdateQueue Changed the underlying data structure used to detected duplicate in OpenSim.Region.Framework.Scenes.Types.UpdateQueue from a List to a Dictionary. --- OpenSim/Region/Framework/Scenes/Types/UpdateQueue.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Types/UpdateQueue.cs b/OpenSim/Region/Framework/Scenes/Types/UpdateQueue.cs index 21cda09..213e954 100644 --- a/OpenSim/Region/Framework/Scenes/Types/UpdateQueue.cs +++ b/OpenSim/Region/Framework/Scenes/Types/UpdateQueue.cs @@ -38,7 +38,7 @@ namespace OpenSim.Region.Framework.Scenes.Types { private Queue m_queue; - private List m_ids; + private Dictionary m_ids; private object m_syncObject = new object(); @@ -50,7 +50,7 @@ namespace OpenSim.Region.Framework.Scenes.Types public UpdateQueue() { m_queue = new Queue(); - m_ids = new List(); + m_ids = new Dictionary(); } public void Clear() @@ -66,9 +66,8 @@ namespace OpenSim.Region.Framework.Scenes.Types { lock (m_syncObject) { - if (!m_ids.Contains(part.UUID)) - { - m_ids.Add(part.UUID); + if (!m_ids.ContainsKey(part.UUID)) { + m_ids.Add(part.UUID, true); m_queue.Enqueue(part); } } -- cgit v1.1