Perf: domainset class w/o build domain map

This commit is contained in:
SukkaW
2024-10-27 03:49:31 +08:00
parent 70a38fddcc
commit a42d28195d
3 changed files with 31 additions and 25 deletions

View File

@@ -26,9 +26,11 @@ export function buildParseDomainMap(inputs: string[]) {
return { domainMap, subdomainMap };
}
export function sortDomains(inputs: string[],
export function sortDomains(
inputs: string[],
domainMap?: Map<string, string> | null,
subdomainMap?: Map<string, string> | null) {
subdomainMap?: Map<string, string> | null
) {
if (!domainMap || !subdomainMap) {
const { domainMap: dm, subdomainMap: sm } = buildParseDomainMap(inputs);
domainMap = dm;