mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-20 17:16:42 +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:
@@ -514,10 +514,10 @@ namespace Emby.Server.Implementations.Library
|
||||
_logger.LogInformation("Live stream opened: {@MediaSource}", mediaSource);
|
||||
var clone = JsonSerializer.Deserialize<MediaSourceInfo>(json, _jsonOptions);
|
||||
|
||||
if (!request.UserId.Equals(Guid.Empty))
|
||||
if (!request.UserId.Equals(default))
|
||||
{
|
||||
var user = _userManager.GetUserById(request.UserId);
|
||||
var item = request.ItemId.Equals(Guid.Empty)
|
||||
var item = request.ItemId.Equals(default)
|
||||
? null
|
||||
: _libraryManager.GetItemById(request.ItemId);
|
||||
SetDefaultAudioAndSubtitleStreamIndexes(item, clone, user);
|
||||
|
||||
Reference in New Issue
Block a user