Remove unnecessary array allocation

Co-authored-by: Claus Vium <cvium@users.noreply.github.com>
This commit is contained in:
Dmitry Lyzo 2022-01-15 15:54:14 +03:00 committed by GitHub
parent 5aa748058e
commit 54549cd5b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -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);
}
}