Remove unnecessary ToList usage

This commit is contained in:
ignacio laborde
2022-01-04 13:05:36 -03:00
committed by jgriff6
parent 790f67aac1
commit c6bf6e00de
8 changed files with 17 additions and 32 deletions

View File

@@ -210,7 +210,7 @@ namespace Emby.Server.Implementations.Collections
var itemList = new List<BaseItem>();
var linkedChildrenList = collection.GetLinkedChildren();
var currentLinkedChildrenIds = linkedChildrenList.Select(i => i.Id).ToList();
var currentLinkedChildrenIds = linkedChildrenList.Select(i => i.Id);
foreach (var id in ids)
{
@@ -232,10 +232,7 @@ namespace Emby.Server.Implementations.Collections
if (list.Count > 0)
{
var newList = collection.LinkedChildren.ToList();
newList.AddRange(list);
collection.LinkedChildren = newList.ToArray();
collection.LinkedChildren = collection.LinkedChildren.Concat(list).ToArray();
collection.UpdateRatingToItems(linkedChildrenList);
await collection.UpdateToRepositoryAsync(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);
@@ -303,7 +300,7 @@ namespace Emby.Server.Implementations.Collections
{
var results = new Dictionary<Guid, BaseItem>();
var allBoxSets = GetCollections(user).ToList();
var allBoxSets = GetCollections(user);
foreach (var item in items)
{