diff --git a/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/PowerNetNodeGroup.cs b/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/PowerNetNodeGroup.cs index 6e6486b79e..59ff48ef1b 100644 --- a/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/PowerNetNodeGroup.cs +++ b/Content.Server/GameObjects/Components/NodeContainer/NodeGroups/PowerNetNodeGroup.cs @@ -29,6 +29,8 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups [NodeGroup(NodeGroupID.HVPower, NodeGroupID.MVPower)] public class PowerNetNodeGroup : BaseNetConnectorNodeGroup, IPowerNet { + private static readonly Priority[] CachedPriorities = (Priority[]) Enum.GetValues(typeof(Priority)); + [Dependency] private readonly IPowerNetManager _powerNetManager = default!; [ViewVariables] @@ -121,7 +123,7 @@ namespace Content.Server.GameObjects.Components.NodeContainer.NodeGroups public void UpdateConsumerReceivedPower() { var remainingSupply = _totalSupply; - foreach (Priority priority in Enum.GetValues(typeof(Priority))) + foreach (var priority in CachedPriorities) { var categoryPowerDemand = _drawByPriority[priority]; if (remainingSupply >= categoryPowerDemand) //can fully power all in category