Perf: re-use trie when building reject domainsets

This commit is contained in:
SukkaW
2024-05-26 01:20:45 +08:00
parent 02bff12245
commit 5b725192e3
3 changed files with 31 additions and 25 deletions

View File

@@ -448,8 +448,13 @@ export const createTrie = (from?: string[] | Set<string> | null, hostnameMode =
return root;
},
whitelist,
[Bun.inspect.custom]: () => JSON.stringify(deepTrieNodeToJSON(root), null, 2)
[Bun.inspect.custom]: () => JSON.stringify(deepTrieNodeToJSON(root), null, 2),
hostnameMode,
smolTree
};
};
export type Trie = ReturnType<typeof createTrie>;
export default createTrie;