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
This commit is contained in:
Bond-009
2019-09-02 08:19:29 +02:00
committed by Anthony Lavado
parent cb393c215a
commit ee637e8fec
37 changed files with 308 additions and 218 deletions

View File

@@ -1441,7 +1441,7 @@ namespace Emby.Server.Implementations.Library
return new QueryResult<BaseItem>
{
Items = list.ToArray()
Items = list
};
}
@@ -1977,8 +1977,7 @@ namespace Emby.Server.Implementations.Library
public LibraryOptions GetLibraryOptions(BaseItem item)
{
var collectionFolder = item as CollectionFolder;
if (collectionFolder == null)
if (!(item is CollectionFolder collectionFolder))
{
collectionFolder = GetCollectionFolders(item)
.OfType<CollectionFolder>()