mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-23 20:36:33 +01:00
CP-36392: Remove base
calls directly based on the object reference.
Two objects will never have the same hash since base methods are based on direct object reference Signed-off-by: Danilo Del Busso <Danilo.Del.Busso@citrix.com>
This commit is contained in:
parent
825c795ea4
commit
2d1e6dcb92
@ -478,19 +478,15 @@ namespace XenAdmin.Controls.CustomDataGraph
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if(!(obj is DataSet))
|
||||
return base.Equals(obj);
|
||||
|
||||
DataSet other = (DataSet)obj;
|
||||
if (!(obj is DataSet other))
|
||||
return false;
|
||||
|
||||
return Id == other.Id;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
if (string.IsNullOrEmpty(Id))
|
||||
return base.GetHashCode();
|
||||
return Id.GetHashCode();
|
||||
return string.IsNullOrEmpty(Id) ? 0 : Id.GetHashCode();
|
||||
}
|
||||
|
||||
internal void InsertPointCollection(List<DataPoint> list)
|
||||
|
@ -678,14 +678,14 @@ namespace XenAdmin.Controls.CustomGridView
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if(!(obj is GridRow))
|
||||
return base.Equals(obj);
|
||||
return OpaqueRef == ((GridRow)obj).OpaqueRef;
|
||||
if (!(obj is GridRow row))
|
||||
return false;
|
||||
return OpaqueRef == row.OpaqueRef;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
return (OpaqueRef != null ? OpaqueRef.GetHashCode() : 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,7 @@ namespace XenAdmin.Controls.DataGridViewEx
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
return _nameCell.GetHashCode();
|
||||
}
|
||||
|
||||
public CheckState Checked
|
||||
|
@ -1121,7 +1121,7 @@ namespace XenAdmin.Controls.XenSearch
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
return (int) type;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1327,7 +1327,7 @@ namespace XenAdmin.Controls.XenSearch
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
return (int) type;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user