Use MinBy and MaxBy

This commit is contained in:
Stepan Goremykin
2023-04-01 23:00:51 +02:00
parent eb59456e78
commit e74630a613
5 changed files with 5 additions and 10 deletions

View File

@@ -1256,8 +1256,7 @@ namespace Jellyfin.Networking.Manager
// Look for the best internal address.
bindAddress = addresses
.Where(p => IsInLocalNetwork(p) && (p.Contains(source) || p.Equals(IPAddress.None)))
.OrderBy(p => p.Tag)
.FirstOrDefault()?.Address;
.MinBy(p => p.Tag)?.Address;
}
if (bindAddress is not null)