Prevent extra loop iterations on buffer init

This commit is contained in:
Cohee 2024-02-23 21:23:44 +02:00
parent 4baefeba68
commit 82c5042bad
1 changed files with 4 additions and 0 deletions

View File

@ -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;
}
}
}