This commit is contained in:
cvium 2021-11-09 22:45:34 +01:00
parent a90735bc5a
commit 3f09fb8d70

View File

@ -1181,8 +1181,9 @@ namespace Emby.Dlna.ContentDirectory
/// <returns>The <see cref="QueryResult{ServerItem}"/>.</returns>
private static QueryResult<ServerItem> ToResult(QueryResult<BaseItem> result)
{
var serverItems = new ServerItem[result.Items.Count];
for (var i = 0; i < result.Items.Count; i++)
var length = result.Items.Count;
var serverItems = new ServerItem[length];
for (var i = 0; i < length; i++)
{
serverItems[i] = new ServerItem(result.Items[i], null);
}
@ -1201,8 +1202,9 @@ namespace Emby.Dlna.ContentDirectory
/// <returns>The <see cref="QueryResult{ServerItem}"/>.</returns>
private static QueryResult<ServerItem> ToResult(QueryResult<(BaseItem, ItemCounts)> result)
{
var serverItems = new ServerItem[result.Items.Count];
for (var i = 0; i < result.Items.Count; i++)
var length = result.Items.Count;
var serverItems = new ServerItem[length];
for (var i = 0; i < length; i++)
{
serverItems[i] = new ServerItem(result.Items[i].Item1, null);
}