Skip to content

Commit 98972c8

Browse files
committed
Pass data to MemoryStream.ctor(byte[]) instead of writing it to the memory stream (which would have it allocate a new buffer).
Fixes issue #1.
1 parent 9597d64 commit 98972c8

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/SshNetTests/TestBase.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,8 @@ protected static string CreateHash(Stream stream)
4040

4141
protected static string CreateHash(byte[] buffer)
4242
{
43-
using (var ms = new MemoryStream())
43+
using (var ms = new MemoryStream(buffer))
4444
{
45-
ms.Write(buffer, 0, buffer.Length);
46-
ms.Position = 0;
47-
4845
return CreateHash(ms);
4946
}
5047
}

0 commit comments

Comments
 (0)