From 456f571343cfd524fd29e22207a806d5acd7d25a Mon Sep 17 00:00:00 2001 From: Vasily Date: Thu, 5 Mar 2020 14:25:50 +0300 Subject: [PATCH] Follow code review suggestions --- MediaBrowser.Controller/Entities/BaseItem.cs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index f2adbf75a..8f504ebb0 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -2921,24 +2921,17 @@ namespace MediaBrowser.Controller.Entities public override bool Equals(object obj) { - Logger.LogDebug("Comparing me ({0}) to generic them ({1})", this, obj); - return this.Equals(obj as BaseItem); + return obj is BaseItem baseItem && this.Equals(baseItem); } public bool Equals(BaseItem item) { - Logger.LogDebug("Comparing me ({0}) to specific them ({1})", this, item); - if (item == null) - { - return false; - } - - return Id == item.Id; + return Object.Equals(Id, item?.Id); } public override int GetHashCode() { - return Id.GetHashCode(); + return HashCode.Combine(Id); } } }