Browse Source

Eliminate cmd allocation in BmpDecoder

pull/604/head
Jason Nelson 8 years ago
parent
commit
f6936c6be0
  1. 4
      src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs

4
src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs

@ -245,7 +245,11 @@ namespace SixLabors.ImageSharp.Formats.Bmp
/// <param name="buffer">Buffer for uncompressed data.</param>
private void UncompressRle8(int w, Span<byte> buffer)
{
#if NETCOREAPP2_1
Span<byte> cmd = stackalloc byte[2];
#else
byte[] cmd = new byte[2];
#endif
int count = 0;
while (count < buffer.Length)

Loading…
Cancel
Save