mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-04-05 20:55:01 +08:00
Eliminate allocation in BasePageFactory
This commit is contained in:
parent
215e12543c
commit
a5e9b438cc
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user