Refactor: minor changes here and there

This commit is contained in:
SukkaW
2024-11-21 00:10:32 +08:00
parent 484afab42c
commit ff8163eccc
7 changed files with 82 additions and 55 deletions

View File

@@ -12,11 +12,9 @@ function createKeywordFilter(keys: string[] | Set<string>) {
// Create a trie with extra fields and information
const put = (key: string) => {
const len = key.length;
let node = root;
for (let idx = 0; idx < len; idx++) {
for (let idx = 0, len = key.length; idx < len; idx++) {
const char = key[idx];
if (node.has(char)) {