Precalculate edge list capacity
This commit is contained in:
parent
1f0b87f3de
commit
3040914afb
|
@ -1,6 +1,7 @@
|
|||
using System.Collections;
|
||||
using System.Numerics;
|
||||
using KeepersCompound.LGS.Database.Chunks;
|
||||
using Serilog;
|
||||
|
||||
namespace KeepersCompound.Lightmapper;
|
||||
|
||||
|
@ -98,7 +99,6 @@ public class PotentiallyVisibleSet
|
|||
public PotentiallyVisibleSet(WorldRep.Cell[] cells)
|
||||
{
|
||||
_graph = new Node[cells.Length];
|
||||
_edges = [];
|
||||
|
||||
var portalCount = 0;
|
||||
foreach (var cell in cells)
|
||||
|
@ -106,6 +106,9 @@ public class PotentiallyVisibleSet
|
|||
portalCount += cell.PortalPolyCount;
|
||||
}
|
||||
|
||||
_edges = new List<Edge>(portalCount);
|
||||
Log.Information("Mission contains {PortalCount} portals.", portalCount);
|
||||
|
||||
for (var i = 0; i < cells.Length; i++)
|
||||
{
|
||||
var cell = cells[i];
|
||||
|
|
Loading…
Reference in New Issue