From c97cf31ccb1702403668b63872394cd5b3539944 Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Mon, 20 Jan 2025 18:30:50 +0000 Subject: [PATCH] Use foreach for edge might see loop --- KeepersCompound.Lightmapper/PotentiallyVisibleSet.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/KeepersCompound.Lightmapper/PotentiallyVisibleSet.cs b/KeepersCompound.Lightmapper/PotentiallyVisibleSet.cs index 5b39838..35b3f58 100644 --- a/KeepersCompound.Lightmapper/PotentiallyVisibleSet.cs +++ b/KeepersCompound.Lightmapper/PotentiallyVisibleSet.cs @@ -120,7 +120,7 @@ public class PotentiallyVisibleSet _graph[i] = new Node(edgeIndices); } - Parallel.For(0, _edges.Count, ComputeEdgeMightSee); + Parallel.ForEach(_edges, ComputeEdgeMightSee); } public int[] GetVisible(int cellIdx) @@ -140,9 +140,8 @@ public class PotentiallyVisibleSet } - private void ComputeEdgeMightSee(int edgeIdx) + private void ComputeEdgeMightSee(Edge source) { - var source = _edges[edgeIdx]; var sourcePlane = source.Poly.Plane; Flood(source.Destination); return;