Skip to content

Commit

Permalink
Further performance improvements in DocstrumBoundingBoxes
Browse files Browse the repository at this point in the history
  • Loading branch information
BobLd committed Jun 27, 2024
1 parent 14e7024 commit b05dfac
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,19 @@ public static bool GetStructuralBlockingParameters(PdfLine i, PdfLine j, double
}

// 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];

if (dXj != 0)
Expand All @@ -477,6 +490,7 @@ public static bool GetStructuralBlockingParameters(PdfLine i, PdfLine j, double
{
Array.Sort(ps, PdfPointYComparer.Instance);
}
#endif

PdfPoint Cj = ps[1];
PdfPoint Dj = ps[2];
Expand Down

0 comments on commit b05dfac

Please sign in to comment.