mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-04-24 14:08:44 -04:00
Small speed improvement - no need to convert an array to a list to just iterate over it
This commit is contained in:
parent
ae1f975b99
commit
f81cd037f0
1 changed files with 3 additions and 3 deletions
|
@ -835,9 +835,9 @@ namespace MediaBrowser.Controller.Entities
|
|||
|
||||
private IReadOnlyList<BaseItem> SortItemsByRequest(InternalItemsQuery query, IReadOnlyList<BaseItem> items)
|
||||
{
|
||||
var ids = query.ItemIds.ToList();
|
||||
var positions = new Dictionary<Guid, OneTimeQueue<int>>(ids.Count);
|
||||
for (int i = 0; i < ids.Count; i++)
|
||||
var ids = query.ItemIds;
|
||||
var positions = new Dictionary<Guid, OneTimeQueue<int>>(ids.Length);
|
||||
for (int i = 0; i < ids.Length; i++)
|
||||
{
|
||||
if (positions.TryGetValue(ids[i], out var q))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue