Skip to content

Commit

Permalink
Add dual array concat overload (#7377)
Browse files Browse the repository at this point in the history
  • Loading branch information
benaadams authored Sep 2, 2024
1 parent 76d5fd6 commit 198fb9c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Nethermind/Nethermind.Core/Extensions/Bytes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,14 @@ public static byte[] PadRight(this byte[] bytes, int length)
return result;
}

public static byte[] Concat(byte[] part1, byte[] part2)
{
byte[] result = new byte[part1.Length + part2.Length];
part1.CopyTo(result, 0);
part2.CopyTo(result.AsSpan(part1.Length));
return result;
}

public static byte[] Concat(params byte[][] parts)
{
int totalLength = 0;
Expand Down

0 comments on commit 198fb9c

Please sign in to comment.