aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations
diff options
context:
space:
mode:
authorDmitry Lyzo <56478732+dmitrylyzo@users.noreply.github.com>2022-01-15 15:54:14 +0300
committerGitHub <noreply@github.com>2022-01-15 15:54:14 +0300
commit54549cd5b5e330cd96a8a527c404a5c4ebaa858c (patch)
treedc54e32869dcff8f26a5c9547dcda397d994ec56 /Emby.Server.Implementations
parent5aa748058e65eb18e1981b111715efd73922f737 (diff)
Remove unnecessary array allocation
Co-authored-by: Claus Vium <cvium@users.noreply.github.com>
Diffstat (limited to 'Emby.Server.Implementations')
-rw-r--r--Emby.Server.Implementations/Dto/DtoService.cs3
1 files changed, 1 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs
index ab7bb618d..88d9303a5 100644
--- a/Emby.Server.Implementations/Dto/DtoService.cs
+++ b/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);
}
}