Skip to content

Commit bfa664d

Browse files
Merge pull request #2905 from paulomorgado/patch-1
Refactor buffer allocation in Vp8BitWriter.cs to use Span<byte> instead of byte[] in WriteFrameHeader
2 parents 7189399 + bc18490 commit bfa664d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ImageSharp/Formats/Webp/BitWriter/Vp8BitWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ private void WriteFrameHeader(Stream stream, uint size0)
604604
uint profile = 0;
605605
int width = this.enc.Width;
606606
int height = this.enc.Height;
607-
byte[] vp8FrameHeader = new byte[WebpConstants.Vp8FrameHeaderSize];
607+
Span<byte> vp8FrameHeader = stackalloc byte[WebpConstants.Vp8FrameHeaderSize];
608608

609609
// Paragraph 9.1.
610610
uint bits = 0 // keyframe (1b)

0 commit comments

Comments
 (0)