From 9bc55e771a012ed4a7f4bdebb930fe64f3977256 Mon Sep 17 00:00:00 2001 From: retoor Date: Tue, 27 May 2025 12:30:42 +0200 Subject: [PATCH] Scrolled to bottom fix. --- src/snek/static/chat-input.js | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/snek/static/chat-input.js b/src/snek/static/chat-input.js index c4aa656..8293097 100644 --- a/src/snek/static/chat-input.js +++ b/src/snek/static/chat-input.js @@ -262,22 +262,14 @@ levenshteinDistance(a, b) { return millisecondsDifference / 1000; } isSubsequence(input, array) { - for (const str of array) { - let i = 0; - let j = 0; - - while (i < input.length && j < str.length) { - if (input[i] === str[j]) { - i++; - } - j++; - } - - if (i === input.length) { - return true; + let i = 0, j = 0; + while (i < s.length && j < t.length) { + if (s[i] === t[j]) { + i++; } + j++; } - return false; + return i === s.length; }