diff options
| author | Vasily <just.one.man@yandex.ru> | 2020-03-05 14:25:50 +0300 |
|---|---|---|
| committer | Vasily <just.one.man@yandex.ru> | 2020-03-05 14:25:50 +0300 |
| commit | 456f571343cfd524fd29e22207a806d5acd7d25a (patch) | |
| tree | 43de2e3200c716b8ce03c93f5969d57a0309b375 | |
| parent | 007c5b9f6734fc7a7b49ad488fe3733edf9c3c67 (diff) | |
Follow code review suggestions
| -rw-r--r-- | MediaBrowser.Controller/Entities/BaseItem.cs | 13 |
1 files 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); } } } |
