From 36be786348adffa3aaf13687ba98de81f8974e47 Mon Sep 17 00:00:00 2001 From: cha0s Date: Thu, 4 Jul 2024 09:10:37 -0500 Subject: [PATCH] perf: avoid work --- app/ecs/system.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/ecs/system.js b/app/ecs/system.js index 86895a4..9b6d381 100644 --- a/app/ecs/system.js +++ b/app/ecs/system.js @@ -118,7 +118,9 @@ export default class System { } tickDestruction() { - this.deindex(this.destroying); + if (this.destroying.length > 0) { + this.deindex(this.destroying); + } this.destroying = []; }