Perf: use new hostname trie

This commit is contained in:
SukkaW
2024-05-11 00:07:43 +08:00
parent 59b86f706f
commit a486910a26
2 changed files with 6 additions and 6 deletions

View File

@@ -3,7 +3,7 @@ import { createTrie } from './trie';
export function domainDeduper(inputDomains: string[], toArray?: true): string[];
export function domainDeduper(inputDomains: string[], toArray: false): Set<string>;
export function domainDeduper(inputDomains: string[], toArray = true): string[] | Set<string> {
const trie = createTrie(inputDomains);
const trie = createTrie(inputDomains, true);
const sets = new Set(inputDomains);
for (let i = 0, len1 = inputDomains.length; i < len1; i++) {