Merge cast with type check

This commit is contained in:
Cinder Biscuits
2020-05-09 08:41:30 -05:00
parent ad32b578d2
commit 823e05df77
23 changed files with 82 additions and 96 deletions

View File

@@ -45,9 +45,8 @@ namespace OpenMetaverse.TestClient
foreach (InventoryBase i in contents)
{
result.AppendFormat("{0}{1} ({2})\n", new String(' ', indent * 2), i.Name, i.UUID);
if (i is InventoryFolder)
if (i is InventoryFolder folder)
{
InventoryFolder folder = (InventoryFolder)i;
PrintFolder(folder, result, indent + 1);
}
}