Simplify conditional expression

This commit is contained in:
Stepan Goremykin
2023-04-06 19:30:17 +02:00
parent 19e65269a2
commit b6cfdb8b92
3 changed files with 3 additions and 9 deletions

View File

@@ -571,9 +571,7 @@ namespace Emby.Server.Implementations.Dto
return null;
}
}).Where(i => i is not null)
.Where(i => user is null ?
true :
i.IsVisible(user))
.Where(i => user is null || i.IsVisible(user))
.DistinctBy(x => x.Name, StringComparer.OrdinalIgnoreCase)
.ToDictionary(i => i.Name, StringComparer.OrdinalIgnoreCase);