Refactor code.

This commit is contained in:
Christian Kratky
2020-05-01 21:47:25 +02:00
parent 48d0344a40
commit 2a421d1d42
8 changed files with 36 additions and 64 deletions
@@ -1,23 +0,0 @@
using System;
namespace MQTTnet.Internal
{
public static class ArraySegmentExtensions
{
public static byte[] ToArray(this ArraySegment<byte> source)
{
if (source.Array == null)
{
return null;
}
var buffer = new byte[source.Count];
if (buffer.Length > 0)
{
Array.Copy(source.Array, source.Offset, buffer, 0, buffer.Length);
}
return buffer;
}
}
}