misc: chore: Use collection expressions in HLE project

This commit is contained in:
Evan Husted
2025-01-26 15:43:02 -06:00
parent 3c2f283ec7
commit 70b767ef60
72 changed files with 312 additions and 299 deletions

View File

@@ -7,7 +7,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy
{
private const ushort EphemeralBase = 49152;
private readonly List<ushort> _ephemeralPorts = new();
private readonly List<ushort> _ephemeralPorts = [];
private readonly Lock _lock = new();

View File

@@ -13,7 +13,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy
public EndPoint LocalEndpoint { get; }
public IPAddress LocalAddress { get; }
private readonly List<LdnProxySocket> _sockets = new();
private readonly List<LdnProxySocket> _sockets = [];
private readonly Dictionary<ProtocolType, EphemeralPortPool> _ephemeralPorts = new();
private readonly IProxyClient _parent;

View File

@@ -18,7 +18,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy
private readonly LdnProxy _proxy;
private bool _isListening;
private readonly List<LdnProxySocket> _listenSockets = new();
private readonly List<LdnProxySocket> _listenSockets = [];
private readonly Queue<ProxyConnectRequest> _connectRequests = new();

View File

@@ -41,9 +41,9 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy
private NatDevice _natDevice;
private Mapping _portMapping;
private readonly List<P2pProxySession> _players = new();
private readonly List<P2pProxySession> _players = [];
private readonly List<ExternalProxyToken> _waitingTokens = new();
private readonly List<ExternalProxyToken> _waitingTokens = [];
private readonly AutoResetEvent _tokenEvent = new(false);
private uint _broadcastAddress;