Even better equality checking
This commit is contained in:
@@ -65,6 +65,10 @@ namespace Upsilon.BaseTypes.UserData
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
if (obj.GetType() == Dictionary.GetType())
|
||||
{
|
||||
return Dictionary.Equals(obj);
|
||||
}
|
||||
if (obj.GetType() != this.GetType()) return false;
|
||||
return Equals((DictionaryUserData) obj);
|
||||
}
|
||||
|
||||
@@ -65,6 +65,10 @@ namespace Upsilon.BaseTypes.UserData
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
if (obj.GetType() == Value.GetType())
|
||||
{
|
||||
return obj.Equals(Value);
|
||||
}
|
||||
if (obj.GetType() != this.GetType()) return false;
|
||||
return Equals((GenericUserData) obj);
|
||||
}
|
||||
|
||||
@@ -81,6 +81,10 @@ namespace Upsilon.BaseTypes.UserData
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
if (obj.GetType() == List.GetType())
|
||||
{
|
||||
return List.Equals(obj);
|
||||
}
|
||||
if (obj.GetType() != this.GetType()) return false;
|
||||
return Equals((ListUserData) obj);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user