!= UUID.Zero is slow

This commit is contained in:
UbitUmarov
2022-01-09 02:28:51 +00:00
parent 7e0fc95c3a
commit da928d6099
78 changed files with 254 additions and 263 deletions

View File

@@ -527,7 +527,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
return;
}
if(itemID != UUID.Zero && ownerID != UUID.Zero)
if(!itemID.IsZero() && !ownerID.IsZero())
{
item = scene.InventoryService.GetItem(ownerID, itemID);
if (item != null)

View File

@@ -348,7 +348,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
public GroupRecord GetGroupRecord(UUID requestingAgentID, UUID GroupID, string GroupName)
{
Hashtable param = new Hashtable();
if (GroupID != UUID.Zero)
if (!GroupID.IsZero())
{
param["GroupID"] = GroupID.ToString();
}

View File

@@ -61,7 +61,6 @@ namespace OpenSim.Region.DataSnapshot
public void OnGetSnapshot(IOSHttpRequest req, IOSHttpResponse resp)
{
Hashtable reply = new Hashtable();
string reqtag;
if(req.QueryAsDictionary.TryGetValue("region", out string snapObj) && !string.IsNullOrWhiteSpace(snapObj))
reqtag = snapObj + req.RemoteIPEndPoint.Address.ToString();

View File

@@ -222,7 +222,7 @@ namespace OpenSim.Region.DataSnapshot.Providers
//TODO: figure how to figure out teleport system landData.landingType
//land texture snapshot uuid
if (parcel.SnapshotID != UUID.Zero)
if (!parcel.SnapshotID.IsZero())
{
XmlNode textureuuid = nodeFactory.CreateNode(XmlNodeType.Element, "image", "");
textureuuid.InnerText = parcel.SnapshotID.ToString();
@@ -232,7 +232,7 @@ namespace OpenSim.Region.DataSnapshot.Providers
string groupName = String.Empty;
//attached user and group
if (parcel.GroupID != UUID.Zero)
if (!parcel.GroupID.IsZero())
{
XmlNode groupblock = nodeFactory.CreateNode(XmlNodeType.Element, "group", "");
XmlNode groupuuid = nodeFactory.CreateNode(XmlNodeType.Element, "groupuuid", "");

View File

@@ -219,9 +219,9 @@ namespace OpenSim.Region.DataSnapshot.Providers
if (textures != null)
{
if (textures.DefaultTexture != null &&
textures.DefaultTexture.TextureID != UUID.Zero &&
textures.DefaultTexture.TextureID != m_DefaultImage &&
textures.DefaultTexture.TextureID != m_BlankImage &&
!textures.DefaultTexture.TextureID.IsZero() &&
textures.DefaultTexture.TextureID.NotEqual(m_DefaultImage) &&
textures.DefaultTexture.TextureID.NotEqual(m_BlankImage) &&
textures.DefaultTexture.RGBA.A < 50f)
{
counts[textures.DefaultTexture.TextureID] = 8;

View File

@@ -478,7 +478,7 @@ namespace OpenSim.Region.UserStatistics
lock (m_sessions)
{
if (agentID != UUID.Zero)
if (!agentID.IsZero())
{
if (!m_sessions.ContainsKey(agentID))
{

View File

@@ -458,7 +458,7 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
if (client != null)
{
if (soundId != UUID.Zero)
if (!soundId.IsZero())
client.SendPlayAttachedSound(soundId, UUID.Zero, UUID.Zero, 1.0f, 0);
client.SendBlueBoxMessage(UUID.Zero, "", text);

View File

@@ -176,7 +176,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
try
{
if (agentID == UUID.Zero)
if (agentID.IsZero())
npcAvatar = new NPCAvatar(firstname, lastname, position,
owner, senseAsAgent, scene);
else
@@ -477,8 +477,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC
/// <returns>true if they do, false if they don't.</returns>
private bool CheckPermissions(NPCAvatar av, UUID callerID)
{
return callerID == UUID.Zero || av.OwnerID == UUID.Zero ||
av.OwnerID == callerID || av.AgentId == callerID;
return callerID.IsZero() || av.OwnerID.IsZero() ||
av.OwnerID.Equals(callerID) || av.AgentId.Equals(callerID);
}
}
}