aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-05-03 22:39:33 +0000
committerJustin Clarke Casey2008-05-03 22:39:33 +0000
commit688940e8103f2b1f55bb48ebe2566d32f872b8f5 (patch)
tree979a633643581349471e3f91bf11bfa545191549 /OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs
parent* Cleaned up code in Terrain, Tree and Map modules. (diff)
downloadopensim-SC-688940e8103f2b1f55bb48ebe2566d32f872b8f5.zip
opensim-SC-688940e8103f2b1f55bb48ebe2566d32f872b8f5.tar.gz
opensim-SC-688940e8103f2b1f55bb48ebe2566d32f872b8f5.tar.bz2
opensim-SC-688940e8103f2b1f55bb48ebe2566d32f872b8f5.tar.xz
* Refactor: Renaming item and folder tree search methods to have Find*() prefixes
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs21
1 files changed, 10 insertions, 11 deletions
diff --git a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs
index f6accf6..39296eb 100644
--- a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs
+++ b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs
@@ -104,14 +104,12 @@ namespace OpenSim.Framework.Communications.Cache
104 } 104 }
105 105
106 /// <summary> 106 /// <summary>
107 /// Does this folder or any of its subfolders contain the given item? 107 /// Returns the item if it exists in this folder or any of this folder's subfolders?
108 /// </summary> 108 /// </summary>
109 /// <param name="itemID"></param> 109 /// <param name="itemID"></param>
110 /// <returns></returns> 110 /// <returns>null if the item is not found</returns>
111 public InventoryItemBase HasItem(LLUUID itemID) 111 public InventoryItemBase FindItem(LLUUID itemID)
112 { 112 {
113 InventoryItemBase base2 = null;
114
115 lock (Items) 113 lock (Items)
116 { 114 {
117 if (Items.ContainsKey(itemID)) 115 if (Items.ContainsKey(itemID))
@@ -124,15 +122,16 @@ namespace OpenSim.Framework.Communications.Cache
124 { 122 {
125 foreach (InventoryFolderImpl folder in SubFolders.Values) 123 foreach (InventoryFolderImpl folder in SubFolders.Values)
126 { 124 {
127 base2 = folder.HasItem(itemID); 125 InventoryItemBase item = folder.FindItem(itemID);
128 if (base2 != null) 126
127 if (item != null)
129 { 128 {
130 break; 129 return item;
131 } 130 }
132 } 131 }
133 } 132 }
134 133
135 return base2; 134 return null;
136 } 135 }
137 136
138 /// <summary> 137 /// <summary>
@@ -171,7 +170,7 @@ namespace OpenSim.Framework.Communications.Cache
171 /// Returns the folder requested if it exists as a descendent of this folder 170 /// Returns the folder requested if it exists as a descendent of this folder
172 /// </summary> 171 /// </summary>
173 /// <returns>The requested folder if it exists, null if it does not.</returns> 172 /// <returns>The requested folder if it exists, null if it does not.</returns>
174 public InventoryFolderImpl GetDescendentFolder(LLUUID folderID) 173 public InventoryFolderImpl FindFolder(LLUUID folderID)
175 { 174 {
176 InventoryFolderImpl returnFolder = null; 175 InventoryFolderImpl returnFolder = null;
177 176
@@ -185,7 +184,7 @@ namespace OpenSim.Framework.Communications.Cache
185 { 184 {
186 foreach (InventoryFolderImpl folder in SubFolders.Values) 185 foreach (InventoryFolderImpl folder in SubFolders.Values)
187 { 186 {
188 returnFolder = folder.GetDescendentFolder(folderID); 187 returnFolder = folder.FindFolder(folderID);
189 if (returnFolder != null) 188 if (returnFolder != null)
190 { 189 {
191 break; 190 break;