Skip to content

Commit

Permalink
clean and organize code
Browse files Browse the repository at this point in the history
  • Loading branch information
alec1o committed May 21, 2024
1 parent ec0cde1 commit ba9aaf0
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/src/partials/Primitive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ public partial class Primitive : IPrimitive
{
private static readonly IPrimitivePrefix Prefix;
private readonly List<byte> _bytes;
public int Position { get; private set; }
public bool IsValid { get; private set; }
public byte[] Data => _bytes.ToArray();
public IPrimitiveAdd Add { get; }
public IPrimitiveGet Get { get; }

static Primitive()
{
Expand All @@ -30,10 +25,13 @@ public Primitive(byte[] data)

_bytes = new List<byte>();

if (data != null && data.Length > 0)
{
_bytes.AddRange(data);
}
if (data != null && data.Length > 0) _bytes.AddRange(data);
}

public int Position { get; private set; }
public bool IsValid { get; private set; }
public byte[] Data => _bytes.ToArray();
public IPrimitiveAdd Add { get; }
public IPrimitiveGet Get { get; }
}
}

0 comments on commit ba9aaf0

Please sign in to comment.