From 8151190a45b98645efb06ea28b1758ffbc75cf7e Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Tue, 20 Oct 2009 10:56:15 -0700 Subject: [PATCH] * Removing ODEPrim and ODECharacter GetHashCode() overrides since they were based on something that could change * Tweaked a few other GetHashCode() overrides to bring them in line with MSDN recommendations --- OpenSim/Framework/Location.cs | 2 +- OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 5 ----- OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 5 ----- OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 2 +- 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/OpenSim/Framework/Location.cs b/OpenSim/Framework/Location.cs index 62ab5c74de..9504e03547 100644 --- a/OpenSim/Framework/Location.cs +++ b/OpenSim/Framework/Location.cs @@ -98,7 +98,7 @@ namespace OpenSim.Framework public override int GetHashCode() { - return X.GetHashCode() * 29 + Y.GetHashCode(); + return X.GetHashCode() ^ Y.GetHashCode(); } public object Clone() diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index ef0e56e05f..71ace163d7 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -231,11 +231,6 @@ namespace OpenSim.Region.Physics.OdePlugin set { m_localID = value; } } - public override int GetHashCode() - { - return (int)m_localID; - } - public override bool Grabbed { set { return; } diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index 63bfc909b8..4581d22a03 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs @@ -259,11 +259,6 @@ namespace OpenSim.Region.Physics.OdePlugin m_localID = value; } } - public override int GetHashCode() - { - return (int)m_localID; - } - public override bool Grabbed { set { return; } diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index 2842f6bed6..3f38bb653f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs @@ -1975,7 +1975,7 @@ namespace OpenSim.Region.ScriptEngine.Shared public override int GetHashCode() { - return Convert.ToInt32(value); + return value.GetHashCode(); }