2
0
Эх сурвалжийг харах

Remove unnecessary array allocation

Co-authored-by: Claus Vium <cvium@users.noreply.github.com>
Dmitry Lyzo 3 жил өмнө
parent
commit
54549cd5b5

+ 1 - 2
Emby.Server.Implementations/Dto/DtoService.cs

@@ -1108,8 +1108,7 @@ namespace Emby.Server.Implementations.Dto
                 }
                 else
                 {
-                    allExtras ??= item.GetExtras().ToArray();
-                    dto.LocalTrailerCount = allExtras.Count(i => i.ExtraType == ExtraType.Trailer);
+                    dto.LocalTrailerCount = (allExtras ?? item.GetExtras()).Count(i => i.ExtraType == ExtraType.Trailer);
                 }
             }