From f1f74217cc191973ccaab708d99098459544fa3a Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sat, 14 Sep 2024 21:50:58 +0300 Subject: [PATCH] Move joiner into constant --- public/scripts/world-info.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/scripts/world-info.js b/public/scripts/world-info.js index 67b473780..0f03ce1e4 100644 --- a/public/scripts/world-info.js +++ b/public/scripts/world-info.js @@ -217,15 +217,16 @@ class WorldInfoBuffer { depth = MAX_SCAN_DEPTH; } - let result = this.#depthBuffer.slice(this.#startDepth, depth).join('\n\x01'); + const JOINER = '\n\x01'; + let result = this.#depthBuffer.slice(this.#startDepth, depth).join(JOINER); if (this.#injectBuffer.length > 0) { - result += '\n\x01' + this.#injectBuffer.join('\n\x01'); + result += JOINER + this.#injectBuffer.join(JOINER); } // Min activations should not include the recursion buffer if (this.#recurseBuffer.length > 0 && scanState !== scan_state.MIN_ACTIVATIONS) { - result += '\n\x01' + this.#recurseBuffer.join('\n\x01'); + result += JOINER + this.#recurseBuffer.join(JOINER); } return result;