Skip to content

Commit

Permalink
refactor: use native queue list in auto holes
Browse files Browse the repository at this point in the history
---

This commit fully replaces `NativeQueue<T>` with `NativeQueueList<T>`.
Additionally, auto planting seeds algorithm is faster (increased performance by 3.5%).
  • Loading branch information
andywiecko committed Jan 7, 2025
1 parent a418b17 commit 69c06fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Runtime/Triangulator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3045,7 +3045,7 @@ private int FindTriangle(T2 p)

private void PlantAuto(Allocator allocator)
{
using var heQueue = new NativeQueue<int>(allocator);
using var heQueue = new NativeQueueList<int>(allocator);
using var loop = new NativeList<int>(allocator);
var heVisited = new NativeArray<bool>(halfedges.Length, allocator);

Expand Down Expand Up @@ -3113,7 +3113,7 @@ private void PlantAuto(Allocator allocator)
}

// Plant seeds for non visited constraint edges
foreach (var h1 in loop)
foreach (var h1 in loop.AsReadOnly())
{
var h2 = NextHalfedge(h1);
if (!heVisited[h2])
Expand Down

0 comments on commit 69c06fe

Please sign in to comment.