Skip to content

Commit

Permalink
Pass data to MemoryStream.ctor(byte[]) instead of writing it to the m…
Browse files Browse the repository at this point in the history
…emory stream (which would have it allocate a new buffer).

Fixes issue #1.
  • Loading branch information
drieseng committed Mar 13, 2022
1 parent 9597d64 commit 98972c8
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/SshNetTests/TestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,8 @@ protected static string CreateHash(Stream stream)

protected static string CreateHash(byte[] buffer)
{
using (var ms = new MemoryStream())
using (var ms = new MemoryStream(buffer))
{
ms.Write(buffer, 0, buffer.Length);
ms.Position = 0;

return CreateHash(ms);
}
}
Expand Down

0 comments on commit 98972c8

Please sign in to comment.