Skip to content

Commit d8b1b58

Browse files
committed
Use ReadOnlySpan
1 parent 564826a commit d8b1b58

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

QRCoder/PdfByteQRCode.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace QRCoder;
99
/// </summary>
1010
public class PdfByteQRCode : AbstractQRCode, IDisposable
1111
{
12-
private readonly byte[] _pdfBinaryComment = new byte[] { 0x25, 0xe2, 0xe3, 0xcf, 0xd3 };
12+
private static ReadOnlySpan<byte> _pdfBinaryComment => [0x25, 0xe2, 0xe3, 0xcf, 0xd3];
1313

1414
/// <summary>
1515
/// Initializes a new instance of the <see cref="PdfByteQRCode"/> class.
@@ -63,7 +63,7 @@ public byte[] GetGraphic(int pixelsPerModule, string darkColorHtmlHex, string li
6363
writer.Flush();
6464

6565
// Binary comment - ensures PDF is treated as binary file (prevents text mode corruption)
66-
stream.Write(_pdfBinaryComment, 0, _pdfBinaryComment.Length);
66+
stream.Write(_pdfBinaryComment);
6767
writer.WriteLine();
6868

6969
writer.Flush();

0 commit comments

Comments
 (0)