From f50a250cd9fac47bcbd9a05e99c8ffe4d294e320 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Mon, 21 Feb 2022 14:15:09 +0100 Subject: Optimize Guid comparisons * Use Guid.Equals(Guid) instead of the == override * Ban the usage of Guid.Equals(Object) to prevent accidental boxing * Compare to default(Guid) instead of Guid.Empty --- MediaBrowser.Controller/Entities/UserView.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'MediaBrowser.Controller/Entities/UserView.cs') diff --git a/MediaBrowser.Controller/Entities/UserView.cs b/MediaBrowser.Controller/Entities/UserView.cs index 5c9be7337..47432ee93 100644 --- a/MediaBrowser.Controller/Entities/UserView.cs +++ b/MediaBrowser.Controller/Entities/UserView.cs @@ -69,11 +69,11 @@ namespace MediaBrowser.Controller.Entities /// public override IEnumerable GetIdsForAncestorQuery() { - if (!DisplayParentId.Equals(Guid.Empty)) + if (!DisplayParentId.Equals(default)) { yield return DisplayParentId; } - else if (!ParentId.Equals(Guid.Empty)) + else if (!ParentId.Equals(default)) { yield return ParentId; } @@ -94,11 +94,11 @@ namespace MediaBrowser.Controller.Entities { var parent = this as Folder; - if (!DisplayParentId.Equals(Guid.Empty)) + if (!DisplayParentId.Equals(default)) { parent = LibraryManager.GetItemById(DisplayParentId) as Folder ?? parent; } - else if (!ParentId.Equals(Guid.Empty)) + else if (!ParentId.Equals(default)) { parent = LibraryManager.GetItemById(ParentId) as Folder ?? parent; } -- cgit v1.2.3