mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-21 16:25:28 +03: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:
@@ -47,7 +47,9 @@ namespace Emby.Server.Implementations.HttpServer.Security
|
||||
{
|
||||
var session = await GetSession(requestContext).ConfigureAwait(false);
|
||||
|
||||
return session.UserId.Equals(Guid.Empty) ? null : _userManager.GetUserById(session.UserId);
|
||||
return session.UserId.Equals(default)
|
||||
? null
|
||||
: _userManager.GetUserById(session.UserId);
|
||||
}
|
||||
|
||||
public Task<User?> GetUser(object requestContext)
|
||||
|
||||
Reference in New Issue
Block a user