refactor: simplify null check

Co-authored-by: Cody Robibero <cody@robibe.ro>
This commit is contained in:
Simon Eßlinger 2020-10-02 01:33:15 +02:00 committed by GitHub
parent d10090b394
commit 21b39a207d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,7 +39,7 @@ namespace Jellyfin.Api.ModelBinders
{
var values = Array.ConvertAll(
value.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries),
x => { return converter.ConvertFromString(x != null ? x.Trim() : x); });
x => converter.ConvertFromString(x?.Trim()));
var typedValues = Array.CreateInstance(elementType, values.Length);
values.CopyTo(typedValues, 0);