mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-15 23:58:57 +00:00
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
This commit is contained in:
@@ -233,7 +233,7 @@ namespace MediaBrowser.Controller.Playlists
|
||||
return base.IsVisible(user);
|
||||
}
|
||||
|
||||
if (user.Id == OwnerUserId)
|
||||
if (user.Id.Equals(OwnerUserId))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -244,8 +244,8 @@ namespace MediaBrowser.Controller.Playlists
|
||||
return base.IsVisible(user);
|
||||
}
|
||||
|
||||
var userId = user.Id.ToString("N", CultureInfo.InvariantCulture);
|
||||
return shares.Any(share => string.Equals(share.UserId, userId, StringComparison.OrdinalIgnoreCase));
|
||||
var userId = user.Id;
|
||||
return shares.Any(share => Guid.TryParse(share.UserId, out var id) && id.Equals(userId));
|
||||
}
|
||||
|
||||
public override bool IsVisibleStandalone(User user)
|
||||
|
||||
Reference in New Issue
Block a user