diff options
| author | Bond-009 <bond.009@outlook.com> | 2019-09-02 08:19:29 +0200 |
|---|---|---|
| committer | Anthony Lavado <anthonylavado@users.noreply.github.com> | 2019-09-02 02:19:29 -0400 |
| commit | ee637e8fecbcefe429babbbbd1325bce7c3fe991 (patch) | |
| tree | e3d76fb8d753dd43d8d0cff16e199b706ba84980 /Emby.Server.Implementations/Library/LibraryManager.cs | |
| parent | cb393c215a2ea75f61d0e3e798c6a4a596d720c2 (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.Server.Implementations/Library/LibraryManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/Library/LibraryManager.cs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index 30ff855cc..36934f65f 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/Emby.Server.Implementations/Library/LibraryManager.cs @@ -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>() |
