aboutsummaryrefslogtreecommitdiff
path: root/Emby.Dlna/ContentDirectory/ControlHandler.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2019-09-02 08:19:29 +0200
committerAnthony Lavado <anthonylavado@users.noreply.github.com>2019-09-02 02:19:29 -0400
commitee637e8fecbcefe429babbbbd1325bce7c3fe991 (patch)
treee3d76fb8d753dd43d8d0cff16e199b706ba84980 /Emby.Dlna/ContentDirectory/ControlHandler.cs
parentcb393c215a2ea75f61d0e3e798c6a4a596d720c2 (diff)
Fix warnings, improve performance (#1665)
* Fix warnings, improve performance `QueryResult.Items` is now a `IReadOnlyList` so we don't need to allocate a new `Array` when we have a `List` (and `Items` shouldn't need to be mutable anyway) * Update Providers .csproj to latest C# * Remove extra newline from DtoService.cs * Remove extra newline from UserLibraryService.cs
Diffstat (limited to 'Emby.Dlna/ContentDirectory/ControlHandler.cs')
-rw-r--r--Emby.Dlna/ContentDirectory/ControlHandler.cs11
1 files changed, 6 insertions, 5 deletions
diff --git a/Emby.Dlna/ContentDirectory/ControlHandler.cs b/Emby.Dlna/ContentDirectory/ControlHandler.cs
index 4f8c89e48..d22fc2177 100644
--- a/Emby.Dlna/ContentDirectory/ControlHandler.cs
+++ b/Emby.Dlna/ContentDirectory/ControlHandler.cs
@@ -289,7 +289,7 @@ namespace Emby.Dlna.ContentDirectory
var childrenResult = GetUserItems(item, serverItem.StubType, user, sortCriteria, start, requestedCount);
totalCount = childrenResult.TotalRecordCount;
- provided = childrenResult.Items.Length;
+ provided = childrenResult.Items.Count;
foreach (var i in childrenResult.Items)
{
@@ -309,6 +309,7 @@ namespace Emby.Dlna.ContentDirectory
}
}
}
+
writer.WriteFullEndElement();
//writer.WriteEndDocument();
}
@@ -386,7 +387,7 @@ namespace Emby.Dlna.ContentDirectory
totalCount = childrenResult.TotalRecordCount;
- provided = childrenResult.Items.Length;
+ provided = childrenResult.Items.Count;
var dlnaOptions = _config.GetDlnaConfiguration();
@@ -677,7 +678,7 @@ namespace Emby.Dlna.ContentDirectory
return new QueryResult<ServerItem>
{
- Items = list.ToArray(),
+ Items = list,
TotalRecordCount = list.Count
};
}
@@ -755,7 +756,7 @@ namespace Emby.Dlna.ContentDirectory
return new QueryResult<ServerItem>
{
- Items = list.ToArray(),
+ Items = list,
TotalRecordCount = list.Count
};
}
@@ -860,7 +861,7 @@ namespace Emby.Dlna.ContentDirectory
return new QueryResult<ServerItem>
{
- Items = list.ToArray(),
+ Items = list,
TotalRecordCount = list.Count
};
}