Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions src/Nethermind/Nethermind.Evm/ByteArrayExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@ private static ZeroPaddedSpan SliceWithZeroPadding(this ReadOnlySpan<byte> span,
return new ZeroPaddedSpan(default, length, padDirection);
}

if (length == 1)
{
// why do we return zero length here?
// it was passing all the tests like this...
// return bytes.Length == 0 ? new byte[0] : new[] {bytes[startIndex]};
return span.Length == 0 ? new ZeroPaddedSpan(default, 0, padDirection) : new ZeroPaddedSpan(span.Slice(startIndex, 1), 0, padDirection);
// return bytes.Length == 0 ? new ZeroPaddedSpan(default, 1) : new ZeroPaddedSpan(bytes.Slice(startIndex, 1), 0);
}

int copiedLength = Math.Min(span.Length - startIndex, length);
return new ZeroPaddedSpan(span.Slice(startIndex, copiedLength), length - copiedLength, padDirection);
}
Expand Down
Loading