From a01b03b6229eba9a0b3113aaa575e357cbfd7555 Mon Sep 17 00:00:00 2001 From: cha0s Date: Thu, 2 May 2019 20:56:32 -0500 Subject: [PATCH] perf: avoid iterator --- server/traits/informed.trait.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/traits/informed.trait.js b/server/traits/informed.trait.js index 2010c1d..f73c802 100644 --- a/server/traits/informed.trait.js +++ b/server/traits/informed.trait.js @@ -191,7 +191,9 @@ export class Informed extends decorate(Trait) { const areaToInform = this.entity.areaToInform; const room = this.entity.room; // Write over entity list for every layer. - for (const {index, layer} of room.layers) { + const layers = room.layers.layers; + for (const index in layers) { + const layer = layers[index]; const visibleEntities = layer.visibleEntities(areaToInform); const reduceEntityListRaw = {}; for (let i = 0; i < visibleEntities.length; ++i) {