From af43f305becd831ccc6c3068cb34700e009a859a Mon Sep 17 00:00:00 2001 From: Bjorn Stromberg Date: Tue, 18 Aug 2020 20:40:47 +0900 Subject: [PATCH] Don't use forEach --- src/js/game/systems/logic_gate.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/js/game/systems/logic_gate.js b/src/js/game/systems/logic_gate.js index 5161aa67..525afe84 100644 --- a/src/js/game/systems/logic_gate.js +++ b/src/js/game/systems/logic_gate.js @@ -18,7 +18,8 @@ export class LogicGateSystem extends GameSystemWithFilter { } update() { - this.allEntities.forEach(entity => { + for (let i = 0; i < this.allEntities.length; ++i) { + const entity = this.allEntities[i]; const logicComp = entity.components.LogicGate; const slotComp = entity.components.WiredPins; @@ -46,7 +47,7 @@ export class LogicGateSystem extends GameSystemWithFilter { assert(slotComp.slots[0].type === enumPinSlotType.logicalEjector, "Slot 0 should be ejector"); slotComp.slots[0].value = result; - }); + } } /**