Reduce some state handling allocs (#14301)

This commit is contained in:
metalgearsloth
2023-03-01 03:05:29 +11:00
committed by GitHub
parent 644e2e2d60
commit b9a805b352
4 changed files with 30 additions and 8 deletions

View File

@@ -108,9 +108,10 @@ public abstract class SharedDoorSystem : EntitySystem
if (args.Current is not DoorComponentState state)
return;
if (!door.CurrentlyCrushing.Equals(state.CurrentlyCrushing))
if (!door.CurrentlyCrushing.SetEquals(state.CurrentlyCrushing))
{
door.CurrentlyCrushing = new(state.CurrentlyCrushing);
door.CurrentlyCrushing.Clear();
door.CurrentlyCrushing.UnionWith(state.CurrentlyCrushing);
}
door.State = state.DoorState;