From 7d44eb953e0ad8630187cf410913c44d541a8c79 Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Thu, 20 Aug 2015 22:38:14 +0100 Subject: [PATCH] Reduce size of GraphConnection for allocation efficiency. --- OpenRA.Mods.Common/Pathfinder/PathGraph.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/OpenRA.Mods.Common/Pathfinder/PathGraph.cs b/OpenRA.Mods.Common/Pathfinder/PathGraph.cs index 6d643161d8..603a8f8cd1 100644 --- a/OpenRA.Mods.Common/Pathfinder/PathGraph.cs +++ b/OpenRA.Mods.Common/Pathfinder/PathGraph.cs @@ -47,13 +47,11 @@ namespace OpenRA.Mods.Common.Pathfinder public struct GraphConnection { - public readonly CPos Source; public readonly CPos Destination; public readonly int Cost; - public GraphConnection(CPos source, CPos destination, int cost) + public GraphConnection(CPos destination, int cost) { - Source = source; Destination = destination; Cost = cost; } @@ -117,7 +115,7 @@ namespace OpenRA.Mods.Common.Pathfinder var neighbor = position + directions[i]; var movementCost = GetCostToNode(neighbor, directions[i]); if (movementCost != Constants.InvalidNode) - validNeighbors.AddLast(new GraphConnection(position, neighbor, movementCost)); + validNeighbors.AddLast(new GraphConnection(neighbor, movementCost)); } return validNeighbors;