Avoid allocations when generating RadarSignatureCells.
The RadarWidget can supply a reusable buffer to each trait to avoid individual traits having to return new enumerables. Additionally, this allows the two traits to avoid LINQ and further allocations as they can manually enumerate and populate the buffer themselves.
This commit is contained in:
@@ -354,7 +354,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public interface IRadarSignature
|
||||
{
|
||||
IEnumerable<Pair<CPos, Color>> RadarSignatureCells(Actor self);
|
||||
void PopulateRadarSignatureCells(Actor self, List<Pair<CPos, Color>> destinationBuffer);
|
||||
}
|
||||
|
||||
public interface IRadarColorModifier { Color RadarColorOverride(Actor self, Color color); }
|
||||
|
||||
Reference in New Issue
Block a user