Skip to content

Commit

Permalink
Merge pull request #87 from greymistcube/chore/use-array-empty
Browse files Browse the repository at this point in the history
⚡ Use `Array.Empty`
  • Loading branch information
greymistcube authored Jul 17, 2023
2 parents bfd4841 + fbfbb05 commit 759e681
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Bencodex/Decoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ Func<string, IFormatProvider, T> converter
int length = ReadLength();
if (length < 1)
{
return (new byte[0], _offset);
return (Array.Empty<byte>(), _offset);
}

int pos = _offset;
Expand Down
2 changes: 1 addition & 1 deletion Bencodex/Types/Binary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ public byte[] ToByteArray()
{
if (ByteArray.IsDefaultOrEmpty)
{
return new byte[0];
return Array.Empty<byte>();
}

return ByteArray.ToBuilder().ToArray();
Expand Down

0 comments on commit 759e681

Please sign in to comment.