mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-02-09 06:02:24 +00:00
Reduce some allocations with the magic of spans etc.
This commit is contained in:
@@ -269,14 +269,17 @@ namespace Emby.Server.Implementations.SyncPlay
|
||||
var user = _userManager.GetUserById(session.UserId);
|
||||
List<GroupInfoDto> list = new List<GroupInfoDto>();
|
||||
|
||||
foreach (var group in _groups.Values)
|
||||
lock (_groupsLock)
|
||||
{
|
||||
// Locking required as group is not thread-safe.
|
||||
lock (group)
|
||||
foreach (var (_, group) in _groups)
|
||||
{
|
||||
if (group.HasAccessToPlayQueue(user))
|
||||
// Locking required as group is not thread-safe.
|
||||
lock (group)
|
||||
{
|
||||
list.Add(group.GetInfo());
|
||||
if (group.HasAccessToPlayQueue(user))
|
||||
{
|
||||
list.Add(group.GetInfo());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user