Further performance improvements in DocstrumBoundingBoxes

This commit is contained in:
BobLd 2024-06-26 15:37:04 +01:00
parent 14e7024545
commit b05dfac672

View File

@ -467,6 +467,19 @@
} }
// Get middle points // Get middle points
#if NET6_0_OR_GREATER
Span<PdfPoint> ps = stackalloc PdfPoint[] { j.Point1, j.Point2, Aj.Value, Bj.Value };
if (dXj != 0)
{
ps.Sort(PdfPointXYComparer.Instance);
}
else if (dYj != 0)
{
ps.Sort(PdfPointYComparer.Instance);
}
#else
PdfPoint[] ps = [j.Point1, j.Point2, Aj.Value, Bj.Value]; PdfPoint[] ps = [j.Point1, j.Point2, Aj.Value, Bj.Value];
if (dXj != 0) if (dXj != 0)
@ -477,6 +490,7 @@
{ {
Array.Sort(ps, PdfPointYComparer.Instance); Array.Sort(ps, PdfPointYComparer.Instance);
} }
#endif
PdfPoint Cj = ps[1]; PdfPoint Cj = ps[1];
PdfPoint Dj = ps[2]; PdfPoint Dj = ps[2];