Skip to content

Commit

Permalink
Use Array.Empty
Browse files Browse the repository at this point in the history
Well actually I'm using C# 12 collection expressions but those compile to Array.Empty
  • Loading branch information
PJB3005 committed Mar 22, 2024
1 parent e5cd7cf commit c9d56d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Lidgren.Network/NetBigInteger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ internal class NetBigInteger
private const long IMASK = 0xffffffffL;
private const ulong UIMASK = (ulong)IMASK;

private static readonly int[] ZeroMagnitude = new int[0];
private static readonly byte[] ZeroEncoding = new byte[0];
private static readonly int[] ZeroMagnitude = [];
private static readonly byte[] ZeroEncoding = [];

public static readonly NetBigInteger Zero = new NetBigInteger(0, ZeroMagnitude, false);
public static readonly NetBigInteger One = createUValueOf(1);
Expand Down Expand Up @@ -2357,4 +2357,4 @@ public object Pop()
}
}
#endif
}
}
2 changes: 1 addition & 1 deletion Lidgren.Network/NetPeer.Internal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ private void InitializeNetwork()
// bind to socket
BindSocket(false);

byte[] macBytes = NetUtility.GetMacAddressBytes() ?? new byte[0];
byte[] macBytes = NetUtility.GetMacAddressBytes() ?? [];

Debug.Assert(m_socket?.LocalEndPoint != null);
NetEndPoint boundEp = (NetEndPoint) m_socket.LocalEndPoint;
Expand Down

0 comments on commit c9d56d9

Please sign in to comment.