mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-09 15:20:34 +02:00
Follow code review suggestions
This commit is contained in:
parent
007c5b9f67
commit
456f571343
|
@ -2921,24 +2921,17 @@ namespace MediaBrowser.Controller.Entities
|
||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
Logger.LogDebug("Comparing me ({0}) to generic them ({1})", this, obj);
|
return obj is BaseItem baseItem && this.Equals(baseItem);
|
||||||
return this.Equals(obj as BaseItem);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(BaseItem item)
|
public bool Equals(BaseItem item)
|
||||||
{
|
{
|
||||||
Logger.LogDebug("Comparing me ({0}) to specific them ({1})", this, item);
|
return Object.Equals(Id, item?.Id);
|
||||||
if (item == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Id == item.Id;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override int GetHashCode()
|
public override int GetHashCode()
|
||||||
{
|
{
|
||||||
return Id.GetHashCode();
|
return HashCode.Combine(Id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue