Skip to content

Commit d5c724e

Browse files
committed
Remove EmptyArray<T> class
1 parent 7fc322a commit d5c724e

File tree

6 files changed

+8
-15
lines changed

6 files changed

+8
-15
lines changed

src/NetMQ/Core/Mechanisms/Mechanism.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ protected void AddBasicProperties(Span<byte> output)
190190
}
191191
else
192192
{
193-
written = AddProperty(output, ZmtpPropertyIdentity, new byte[0]);
193+
written = AddProperty(output, ZmtpPropertyIdentity, []);
194194
output = output.Slice(written);
195195
}
196196
}

src/NetMQ/Core/Patterns/Utils/MultiTrie.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ private bool AddHelper(Span<byte> prefix, [NotNull] Pipe pipe)
149149
/// <returns></returns>
150150
public bool RemoveHelper([NotNull] Pipe pipe, [NotNull] MultiTrieDelegate func, [CanBeNull] object arg)
151151
{
152-
return RemoveHelper(pipe, EmptyArray<byte>.Instance, 0, 0, func, arg);
152+
return RemoveHelper(pipe, [], 0, 0, func, arg);
153153
}
154154

155155
private bool RemoveHelper([NotNull] Pipe pipe, [NotNull] byte[] buffer, int bufferSize, int maxBufferSize, [NotNull] MultiTrieDelegate func, [CanBeNull] object arg)

src/NetMQ/EmptyArray.cs

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/NetMQ/NetMQFrame.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class NetMQFrame : IEquatable<NetMQFrame>, IEquatable<byte[]>
2525
/// <param name="buffer">a byte-array to hold as the frame's data</param>
2626
public NetMQFrame(byte[]? buffer)
2727
{
28-
buffer ??= EmptyArray<byte>.Instance;
28+
buffer ??= [];
2929

3030
Buffer = buffer;
3131
MessageSize = buffer.Length;

src/NetMQ/NetMQQueue.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public void Enqueue(T value)
128128
m_queue.Enqueue(value);
129129

130130
var msg = new Msg();
131-
msg.InitGC(EmptyArray<byte>.Instance, 0);
131+
msg.InitGC([], 0);
132132

133133
lock (m_writer)
134134
m_writer.TrySend(ref msg, SendReceiveConstants.InfiniteTimeout, false);

src/NetMQ/OutgoingSocketExtensions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ public static bool TrySendMultipartMessage(this IOutgoingSocket socket, NetMQMes
507507
/// <param name="more">set this flag to true to signal that you will be immediately sending another frame (optional: default is false)</param>
508508
public static void SendFrameEmpty(this IOutgoingSocket socket, bool more = false)
509509
{
510-
SendFrame(socket, EmptyArray<byte>.Instance, more);
510+
SendFrame(socket, [], more);
511511
}
512512

513513

@@ -519,7 +519,7 @@ public static void SendFrameEmpty(this IOutgoingSocket socket, bool more = false
519519
/// <returns>a reference to this IOutgoingSocket so that method-calls may be chained together</returns>
520520
public static IOutgoingSocket SendMoreFrameEmpty(this IOutgoingSocket socket)
521521
{
522-
SendFrame(socket, EmptyArray<byte>.Instance, true);
522+
SendFrame(socket, [], true);
523523

524524
return socket;
525525
}
@@ -538,7 +538,7 @@ public static IOutgoingSocket SendMoreFrameEmpty(this IOutgoingSocket socket)
538538
/// <returns><c>true</c> if a message was available, otherwise <c>false</c>.</returns>
539539
public static bool TrySendFrameEmpty(this IOutgoingSocket socket, TimeSpan timeout, bool more = false)
540540
{
541-
return TrySendFrame(socket, timeout, EmptyArray<byte>.Instance, more);
541+
return TrySendFrame(socket, timeout, [], more);
542542
}
543543

544544
#endregion
@@ -554,7 +554,7 @@ public static bool TrySendFrameEmpty(this IOutgoingSocket socket, TimeSpan timeo
554554
/// <returns><c>true</c> if a message was available, otherwise <c>false</c>.</returns>
555555
public static bool TrySendFrameEmpty(this IOutgoingSocket socket, bool more = false)
556556
{
557-
return TrySendFrame(socket, EmptyArray<byte>.Instance, more);
557+
return TrySendFrame(socket, [], more);
558558
}
559559

560560
#endregion

0 commit comments

Comments
 (0)