Perf: minor optimization here and there

This commit is contained in:
SukkaW
2024-01-14 22:58:53 +08:00
parent 9bb0c14d5f
commit eaf993deca
4 changed files with 44 additions and 50 deletions

View File

@@ -58,7 +58,7 @@ export const createTrie = (from?: string[] | Set<string>) => {
/**
* Method used to retrieve every item in the trie with the given prefix.
*/
const find = (suffix: string, includeEqualWithSuffix = true): string[] => {
const find = (suffix: string, /** @default true */ includeEqualWithSuffix = true): string[] => {
let node: TrieNode = root;
let token: string;