From 82c5042bad80504f42fcaff52a44697870acb1f8 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Fri, 23 Feb 2024 21:23:44 +0200 Subject: [PATCH] Prevent extra loop iterations on buffer init --- public/scripts/world-info.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/scripts/world-info.js b/public/scripts/world-info.js index 79a80eaa6..cb819a055 100644 --- a/public/scripts/world-info.js +++ b/public/scripts/world-info.js @@ -113,6 +113,10 @@ class WorldInfoBuffer { if (messages[depth]) { this.#depthBuffer[depth] = messages[depth].trim(); } + // break if last message is reached + if (depth === messages.length - 1) { + break; + } } }