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