mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-04-28 20:23:02 +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))
|
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++)
|
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
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user