Skip to content

Commit c9d56d9

Browse files
committed
Use Array.Empty
Well actually I'm using C# 12 collection expressions but those compile to Array.Empty
1 parent e5cd7cf commit c9d56d9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Lidgren.Network/NetBigInteger.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ internal class NetBigInteger
1414
private const long IMASK = 0xffffffffL;
1515
private const ulong UIMASK = (ulong)IMASK;
1616

17-
private static readonly int[] ZeroMagnitude = new int[0];
18-
private static readonly byte[] ZeroEncoding = new byte[0];
17+
private static readonly int[] ZeroMagnitude = [];
18+
private static readonly byte[] ZeroEncoding = [];
1919

2020
public static readonly NetBigInteger Zero = new NetBigInteger(0, ZeroMagnitude, false);
2121
public static readonly NetBigInteger One = createUValueOf(1);
@@ -2357,4 +2357,4 @@ public object Pop()
23572357
}
23582358
}
23592359
#endif
2360-
}
2360+
}

Lidgren.Network/NetPeer.Internal.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ private void InitializeNetwork()
189189
// bind to socket
190190
BindSocket(false);
191191

192-
byte[] macBytes = NetUtility.GetMacAddressBytes() ?? new byte[0];
192+
byte[] macBytes = NetUtility.GetMacAddressBytes() ?? [];
193193

194194
Debug.Assert(m_socket?.LocalEndPoint != null);
195195
NetEndPoint boundEp = (NetEndPoint) m_socket.LocalEndPoint;

0 commit comments

Comments
 (0)