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:
@@ -139,7 +139,9 @@ namespace Emby.Server.Implementations.Playlists
|
||||
{
|
||||
new Share
|
||||
{
|
||||
UserId = options.UserId.Equals(Guid.Empty) ? null : options.UserId.ToString("N", CultureInfo.InvariantCulture),
|
||||
UserId = options.UserId.Equals(default)
|
||||
? null
|
||||
: options.UserId.ToString("N", CultureInfo.InvariantCulture),
|
||||
CanEdit = true
|
||||
}
|
||||
}
|
||||
@@ -188,7 +190,7 @@ namespace Emby.Server.Implementations.Playlists
|
||||
|
||||
public Task AddToPlaylistAsync(Guid playlistId, IReadOnlyCollection<Guid> itemIds, Guid userId)
|
||||
{
|
||||
var user = userId.Equals(Guid.Empty) ? null : _userManager.GetUserById(userId);
|
||||
var user = userId.Equals(default) ? null : _userManager.GetUserById(userId);
|
||||
|
||||
return AddToPlaylistInternal(playlistId, itemIds, user, new DtoOptions(false)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user