misc: chore: Use collection expressions in HLE project
This commit is contained in:
@@ -40,7 +40,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu
|
||||
private readonly RyuLdnProtocol _protocol;
|
||||
private readonly NetworkTimeout _timeout;
|
||||
|
||||
private readonly List<NetworkInfo> _availableGames = new();
|
||||
private readonly List<NetworkInfo> _availableGames = [];
|
||||
private DisconnectReason _disconnectReason;
|
||||
|
||||
private P2pProxyServer _hostedProxy;
|
||||
@@ -109,7 +109,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu
|
||||
|
||||
ConnectAsync();
|
||||
|
||||
int index = WaitHandle.WaitAny(new WaitHandle[] { _connected, _error }, FailureTimeout);
|
||||
int index = WaitHandle.WaitAny([_connected, _error], FailureTimeout);
|
||||
|
||||
if (IsConnected)
|
||||
{
|
||||
@@ -326,7 +326,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu
|
||||
|
||||
SendAsync(_protocol.Encode(PacketId.Reject, new RejectRequest(disconnectReason, nodeId)));
|
||||
|
||||
int index = WaitHandle.WaitAny(new WaitHandle[] { _reject, _error }, InactiveTimeout);
|
||||
int index = WaitHandle.WaitAny([_reject, _error], InactiveTimeout);
|
||||
|
||||
if (index == 0)
|
||||
{
|
||||
@@ -566,13 +566,13 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu
|
||||
|
||||
SendAsync(_protocol.Encode(PacketId.Scan, scanFilter));
|
||||
|
||||
index = WaitHandle.WaitAny(new WaitHandle[] { _scan, _error }, ScanTimeout);
|
||||
index = WaitHandle.WaitAny([_scan, _error], ScanTimeout);
|
||||
}
|
||||
|
||||
if (index != 0)
|
||||
{
|
||||
// An error occurred or timeout. Write 0 games.
|
||||
return Array.Empty<NetworkInfo>();
|
||||
return [];
|
||||
}
|
||||
|
||||
return _availableGames.ToArray();
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user