diff options
| author | ignacio laborde <laborde.ignacio@gmail.com> | 2022-01-04 13:05:36 -0300 |
|---|---|---|
| committer | jgriff6 <74262798+jgriff6@users.noreply.github.com> | 2022-10-25 00:38:57 +0100 |
| commit | c6bf6e00de5906844396bee59e9e891b2903815e (patch) | |
| tree | 010d6bd046dea9f8e0cbd7268593e19b8271cd74 /Emby.Server.Implementations/Collections | |
| parent | 790f67aac11e5c32bad19126d4e35b2afa259006 (diff) | |
Remove unnecessary ToList usage
Diffstat (limited to 'Emby.Server.Implementations/Collections')
| -rw-r--r-- | Emby.Server.Implementations/Collections/CollectionManager.cs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Emby.Server.Implementations/Collections/CollectionManager.cs b/Emby.Server.Implementations/Collections/CollectionManager.cs index 5fc2e39a7..1bbcbe2dd 100644 --- a/Emby.Server.Implementations/Collections/CollectionManager.cs +++ b/Emby.Server.Implementations/Collections/CollectionManager.cs @@ -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) { |
