Minor changes here and there

This commit is contained in:
SukkaW
2024-02-06 15:49:51 +08:00
parent b7cae1061c
commit 7b2334ee3b
11 changed files with 37 additions and 82 deletions

View File

@@ -211,11 +211,11 @@ export const createTrie = (from?: string[] | Set<string> | null) => {
for (let i = suffix.length - 1; i >= 0; i--) {
const token = suffix[i];
if (node.has(token)) {
node = node.get(token)!;
} else {
if (!node.has(token)) {
return false;
}
node = node.get(token)!;
}
return node[SENTINEL];