Skip to content

Commit

Permalink
Optimization: reduce number of allocations on hot path.
Browse files Browse the repository at this point in the history
  • Loading branch information
awgil authored and ikpil committed Mar 5, 2024
1 parent 4b8cd8e commit 7dfac39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DotRecast.Recast/RcRasterizations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ private static void DividePoly(float[] inVerts, int inVertsOffset, int inVertsCo
float axisOffset, int axis)
{
// How far positive or negative away from the separating axis is each vertex.
float[] inVertAxisDelta = new float[12];
Span<float> inVertAxisDelta = stackalloc float[12];
for (int inVert = 0; inVert < inVertsCount; ++inVert)
{
inVertAxisDelta[inVert] = axisOffset - inVerts[inVertsOffset + inVert * 3 + axis];
Expand Down

0 comments on commit 7dfac39

Please sign in to comment.