Skip to content

Commit e3ff49b

Browse files
authored
Remove use of NO_MEM_BUFFER (#1330)
1 parent 9545401 commit e3ff49b

2 files changed

Lines changed: 0 additions & 9 deletions

File tree

‎NBitcoin/Crypto/HashStream.cs‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -310,12 +310,7 @@ public override void WriteByte(byte value)
310310

311311
public override uint256 GetHash()
312312
{
313-
#if NO_MEM_BUFFER
314-
var copy = ms.ToArray();
315-
return GetHash(copy, 0, (int)copy.Length);
316-
#else
317313
return GetHash(ms.GetBuffer(), 0, (int)ms.Length);
318-
#endif
319314
}
320315

321316
protected abstract uint256 GetHash(byte[] data, int offset, int length);

‎NBitcoin/IBitcoinSerializable.cs‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,9 @@ public static byte[] ToBytes(this IBitcoinSerializable serializable, uint? versi
9090

9191
public static byte[] ToArrayEfficient(this MemoryStream ms)
9292
{
93-
#if NO_MEM_BUFFER
94-
return ms.ToArray();
95-
#else
9693
var bytes = ms.GetBuffer();
9794
Array.Resize(ref bytes, (int)ms.Length);
9895
return bytes;
99-
#endif
10096
}
10197
}
10298
}

0 commit comments

Comments
 (0)