Apply suggestions from code review

Co-Authored-By: Bond-009 <bond.009@outlook.com>
pull/2476/head
Vasily 5 years ago committed by GitHub
parent 7f38af3701
commit 9a9f2aa293
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -807,7 +807,7 @@ namespace MediaBrowser.Controller.Entities
return false;
}
private IReadOnlyList<BaseItem> SortItemsByRequest(InternalItemsQuery query, IReadOnlyList<BaseItem> items)
private static BaseItem[] SortItemsByRequest(InternalItemsQuery query, IReadOnlyList<BaseItem> items)
{
var ids = query.ItemIds;
int size = items.Count;
@ -825,10 +825,11 @@ namespace MediaBrowser.Controller.Entities
}
var newItems = new BaseItem[size];
foreach(var item in items)
foreach (var item in items)
{
newItems[positions[item.Id]] = item;
}
return newItems;
}
@ -842,6 +843,7 @@ namespace MediaBrowser.Controller.Entities
{
result.Items = SortItemsByRequest(query, result.Items);
}
return result;
}
@ -860,6 +862,7 @@ namespace MediaBrowser.Controller.Entities
{
return SortItemsByRequest(query, result);
}
return result.ToArray();
}

Loading…
Cancel
Save