Reuse TargetTypes collection in FrozenActor.RefreshState.
This commit is contained in:
@@ -101,7 +101,10 @@ namespace OpenRA.Traits
|
|||||||
public void RefreshState()
|
public void RefreshState()
|
||||||
{
|
{
|
||||||
Owner = actor.Owner;
|
Owner = actor.Owner;
|
||||||
TargetTypes = actor.GetEnabledTargetTypes().ToHashSet();
|
|
||||||
|
// PERF: Reuse collection to avoid allocations.
|
||||||
|
TargetTypes.Clear();
|
||||||
|
TargetTypes.UnionWith(actor.GetEnabledTargetTypes());
|
||||||
|
|
||||||
if (health != null)
|
if (health != null)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user