diff options
author | James J Greensky | 2009-09-30 16:52:59 -0700 |
---|---|---|
committer | John Hurliman | 2009-09-30 17:53:32 -0700 |
commit | 8e3dd64282495e8f7b18efcb2a2e57218a3db6ad (patch) | |
tree | 2e0b59c34d8799ceaab089bc3b6c69cc6c8b82fa /OpenSim/Region | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-8e3dd64282495e8f7b18efcb2a2e57218a3db6ad.zip opensim-SC-8e3dd64282495e8f7b18efcb2a2e57218a3db6ad.tar.gz opensim-SC-8e3dd64282495e8f7b18efcb2a2e57218a3db6ad.tar.bz2 opensim-SC-8e3dd64282495e8f7b18efcb2a2e57218a3db6ad.tar.xz |
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.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Types/UpdateQueue.cs | 9 |
1 files changed, 4 insertions, 5 deletions
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 | |||
38 | { | 38 | { |
39 | private Queue<SceneObjectPart> m_queue; | 39 | private Queue<SceneObjectPart> m_queue; |
40 | 40 | ||
41 | private List<UUID> m_ids; | 41 | private Dictionary<UUID, bool> m_ids; |
42 | 42 | ||
43 | private object m_syncObject = new object(); | 43 | private object m_syncObject = new object(); |
44 | 44 | ||
@@ -50,7 +50,7 @@ namespace OpenSim.Region.Framework.Scenes.Types | |||
50 | public UpdateQueue() | 50 | public UpdateQueue() |
51 | { | 51 | { |
52 | m_queue = new Queue<SceneObjectPart>(); | 52 | m_queue = new Queue<SceneObjectPart>(); |
53 | m_ids = new List<UUID>(); | 53 | m_ids = new Dictionary<UUID, bool>(); |
54 | } | 54 | } |
55 | 55 | ||
56 | public void Clear() | 56 | public void Clear() |
@@ -66,9 +66,8 @@ namespace OpenSim.Region.Framework.Scenes.Types | |||
66 | { | 66 | { |
67 | lock (m_syncObject) | 67 | lock (m_syncObject) |
68 | { | 68 | { |
69 | if (!m_ids.Contains(part.UUID)) | 69 | if (!m_ids.ContainsKey(part.UUID)) { |
70 | { | 70 | m_ids.Add(part.UUID, true); |
71 | m_ids.Add(part.UUID); | ||
72 | m_queue.Enqueue(part); | 71 | m_queue.Enqueue(part); |
73 | } | 72 | } |
74 | } | 73 | } |