Eliminate allocation in BasePageFactory

This commit is contained in:
Jason Nelson 2024-04-03 22:15:04 -07:00 committed by BobLd
parent 215e12543c
commit a5e9b438cc

View File

@ -118,7 +118,7 @@
}
else if (DirectObjectFinder.TryGet<ArrayToken>(contents, PdfScanner, out var array))
{
using var bytes = new ArrayPoolBufferWriter<byte>();
using var bytes = new ArrayPoolBufferWriter<byte>(1024 * 64);
for (var i = 0; i < array.Data.Count; i++)
{
@ -144,7 +144,7 @@
}
}
page = ProcessPageInternal(number, dictionary, namedDestinations, mediaBox, cropBox, userSpaceUnit, rotation, initialMatrix, bytes.WrittenSpan.ToArray());
page = ProcessPageInternal(number, dictionary, namedDestinations, mediaBox, cropBox, userSpaceUnit, rotation, initialMatrix, bytes.WrittenMemory);
}
else
{