mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 17:55:48 +08:00
remove a lock on hginventorybroker; cosmetics
This commit is contained in:
@@ -68,8 +68,8 @@ namespace OpenSim.Capabilities.Handlers
|
||||
{
|
||||
//m_log.DebugFormat("[XXX]: FetchInventoryDescendentsRequest in {0}, {1}", (m_Scene == null) ? "none" : m_Scene.Name, request);
|
||||
|
||||
List<LLSDFetchInventoryDescendents> folders = null;
|
||||
List<UUID> bad_folders = new List<UUID>();
|
||||
List<LLSDFetchInventoryDescendents> folders;
|
||||
List<UUID> bad_folders = new();
|
||||
try
|
||||
{
|
||||
OSDArray foldersrequested = null;
|
||||
@@ -97,7 +97,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||
}
|
||||
else
|
||||
{
|
||||
LLSDFetchInventoryDescendents llsdRequest = new LLSDFetchInventoryDescendents();
|
||||
LLSDFetchInventoryDescendents llsdRequest = new();
|
||||
try
|
||||
{
|
||||
llsdRequest.folder_id = id;
|
||||
@@ -115,12 +115,11 @@ namespace OpenSim.Capabilities.Handlers
|
||||
}
|
||||
}
|
||||
foldersrequested = null;
|
||||
map.Clear();
|
||||
map = null;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[FETCH INV DESC]: fail parsing request: {0}", e.Message);
|
||||
m_log.Error("[FETCH INV DESC]: fail parsing request: " + e.Message);
|
||||
httpResponse.RawBuffer = EmptyResponse;
|
||||
return;
|
||||
}
|
||||
@@ -175,7 +174,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||
//m_log.DebugFormat("[XXX]: Got {0} folders from a request of {1}", invcollSet.Count, folders.Count);
|
||||
|
||||
int invcollSetCount = 0;
|
||||
if (invcollSet != null)
|
||||
if (invcollSet is not null)
|
||||
invcollSetCount = invcollSet.Count;
|
||||
|
||||
osUTF8 lastresponse = LLSDxmlEncode2.Start();
|
||||
@@ -197,7 +196,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||
LLSDxmlEncode2.AddElem("descendents", thiscoll.Descendents, lastresponse);
|
||||
LLSDxmlEncode2.AddElem_version(thiscoll.Version, lastresponse);
|
||||
|
||||
if (thiscoll.Folders == null || thiscoll.Folders.Count == 0)
|
||||
if (thiscoll.Folders is null || thiscoll.Folders.Count == 0)
|
||||
LLSDxmlEncode2.AddEmptyArray("categories", lastresponse);
|
||||
else
|
||||
{
|
||||
@@ -217,7 +216,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||
LLSDxmlEncode2.AddEndArray(lastresponse);
|
||||
}
|
||||
|
||||
if (thiscoll.Items == null || thiscoll.Items.Count == 0)
|
||||
if (thiscoll.Items is null || thiscoll.Items.Count == 0)
|
||||
LLSDxmlEncode2.AddEmptyArray("items", lastresponse);
|
||||
else
|
||||
{
|
||||
@@ -283,8 +282,8 @@ namespace OpenSim.Capabilities.Handlers
|
||||
{
|
||||
if ((fold = m_LibraryService.LibraryRootFolder.FindFolder(f.folder_id)) is not null)
|
||||
{
|
||||
InventoryCollection Collection = new InventoryCollection();
|
||||
// ret.Collection.Folders = new List<InventoryFolderBase>();
|
||||
InventoryCollection Collection = new();
|
||||
//ret.Collection.Folders = new List<InventoryFolderBase>();
|
||||
Collection.Folders = fold.RequestListOfFolders();
|
||||
Collection.Items = fold.RequestListOfItems();
|
||||
Collection.OwnerID = m_LibraryService.LibraryRootFolder.Owner;
|
||||
@@ -306,11 +305,11 @@ namespace OpenSim.Capabilities.Handlers
|
||||
|
||||
// FIXME MAYBE: We're not handling sortOrder!
|
||||
|
||||
List<InventoryCollection> result = new List<InventoryCollection>(32);
|
||||
List<LLSDFetchInventoryDescendents> libFolders = new List<LLSDFetchInventoryDescendents>(32);
|
||||
List<LLSDFetchInventoryDescendents> otherFolders = new List<LLSDFetchInventoryDescendents>(32);
|
||||
HashSet<UUID> libIDs = new HashSet<UUID>();
|
||||
HashSet<UUID> otherIDs = new HashSet<UUID>();
|
||||
List<InventoryCollection> result = new(32);
|
||||
List<LLSDFetchInventoryDescendents> libFolders = new(32);
|
||||
List<LLSDFetchInventoryDescendents> otherFolders = new(32);
|
||||
HashSet<UUID> libIDs = new();
|
||||
HashSet<UUID> otherIDs = new();
|
||||
|
||||
bool dolib = m_LibraryService != null;
|
||||
|
||||
@@ -401,7 +400,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||
|
||||
private bool BadFolder(LLSDFetchInventoryDescendents freq, InventoryCollection contents, List<UUID> bad_folders)
|
||||
{
|
||||
if (contents == null)
|
||||
if (contents is null)
|
||||
{
|
||||
bad_folders.Add(freq.folder_id);
|
||||
return true;
|
||||
@@ -433,7 +432,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||
// viewers are lasy and want a copy of the linked item sent before the link to it
|
||||
|
||||
// look for item links
|
||||
List<UUID> itemIDs = new List<UUID>();
|
||||
List<UUID> itemIDs = new();
|
||||
foreach (InventoryItemBase item in contents.Items)
|
||||
{
|
||||
//m_log.DebugFormat("[XXX]: {0} {1}", item.Name, item.AssetType);
|
||||
|
||||
Reference in New Issue
Block a user