cosmetics
diff --git a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs
index f80c8e0..2d7ead4 100644
--- a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs
+++ b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs
@@ -803,7 +803,7 @@ namespace OpenSim.Data.MySQL
{
while (reader.Read())
{
- data.Add(new OSDString((string)reader["snapshotuuid"].ToString ()));
+ data.Add(new OSDString(reader["snapshotuuid"].ToString ()));
}
}
}
diff --git a/OpenSim/Framework/Animation.cs b/OpenSim/Framework/Animation.cs
index 7d53d82..8e3b54d 100644
--- a/OpenSim/Framework/Animation.cs
+++ b/OpenSim/Framework/Animation.cs
@@ -140,9 +140,7 @@ namespace OpenSim.Framework
public override string ToString()
{
- return "AnimID=" + AnimID.ToString()
- + "/seq=" + SequenceNum.ToString()
- + "/objID=" + ObjectID.ToString();
+ return $"AnimID= {AnimID}/seq={SequenceNum}/objID={ObjectID}";
}
}
diff --git a/OpenSim/Framework/Monitoring/JobEngine.cs b/OpenSim/Framework/Monitoring/JobEngine.cs
index 3f71811..f1eb757 100644
--- a/OpenSim/Framework/Monitoring/JobEngine.cs
+++ b/OpenSim/Framework/Monitoring/JobEngine.cs
@@ -257,7 +257,6 @@ namespace OpenSim.Framework.Monitoring
m_log.DebugFormat("[{0}]: Processed job {1}",LoggingName,currentJob.Name);
currentJob.Action = null;
- currentJob = null;
}
lock (JobLock)
--m_numberThreads;
diff --git a/OpenSim/Region/Framework/Scenes/Scripting/ScriptUtils.cs b/OpenSim/Region/Framework/Scenes/Scripting/ScriptUtils.cs
index 6040680..8d5badf 100644
--- a/OpenSim/Region/Framework/Scenes/Scripting/ScriptUtils.cs
+++ b/OpenSim/Region/Framework/Scenes/Scripting/ScriptUtils.cs
@@ -25,8 +25,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
using OpenMetaverse;
using OpenSim.Framework;
@@ -64,7 +62,7 @@ namespace OpenSim.Region.Framework.Scenes.Scripting
/// <returns></returns>
public static UUID GetAssetIdFromKeyOrItemName(SceneObjectPart part, string identifier)
{
- if(string.IsNullOrEmpty(identifier))
+ if(string.IsNullOrEmpty(identifier) || part.Inventory is null)
return UUID.Zero;
// if we can parse the string as a key, use it.
@@ -73,14 +71,8 @@ namespace OpenSim.Region.Framework.Scenes.Scripting
if (UUID.TryParse(identifier, out UUID key))
return key;
- if (part.Inventory != null)
- {
- TaskInventoryItem item = part.Inventory.GetInventoryItem(identifier);
- if (item != null)
- return item.AssetID;
- }
-
- return UUID.Zero;
+ TaskInventoryItem item = part.Inventory.GetInventoryItem(identifier);
+ return item is not null ? item.AssetID : UUID.Zero;
}
/// <summary>
@@ -93,17 +85,11 @@ namespace OpenSim.Region.Framework.Scenes.Scripting
/// <returns></returns>
public static UUID GetAssetIdFromKeyOrItemName(SceneObjectPart part, string identifier, AssetType type)
{
- if (UUID.TryParse(identifier, out UUID key))
+ if (UUID.TryParse(identifier, out UUID key) || part.Inventory is null)
return key;
- if (part.Inventory is not null)
- {
- TaskInventoryItem item = part.Inventory.GetInventoryItem(identifier, (int)type);
- if (item is not null)
- return item.AssetID;
- }
-
- return UUID.Zero;
+ TaskInventoryItem item = part.Inventory.GetInventoryItem(identifier, (int)type);
+ return item is not null ? item.AssetID : UUID.Zero;
}
public static UUID GetAssetIdFromKeyOrItemName(SceneObjectPart part, SceneObjectPart host, string identifier, AssetType type)
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index 068e285..53cf030 100755
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -639,7 +639,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
public bool IsGroupMember(UUID groupID)
{
- return (m_hostGroupID == groupID);
+ return m_hostGroupID.Equals(groupID);
}
public Dictionary<UUID, ulong> GetGroupPowers()