mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Perf: 1-pass domain parse
This commit is contained in:
@@ -39,18 +39,6 @@ export const sortDomains = (
|
||||
subdomainMap = sm;
|
||||
}
|
||||
|
||||
for (let i = 0, len = inputs.length; i < len; i++) {
|
||||
const cur = inputs[i];
|
||||
if (!domainMap.has(cur)) {
|
||||
const topD = getDomain(cur, looseTldtsOpt);
|
||||
domainMap.set(cur, topD ?? cur);
|
||||
}
|
||||
if (!subdomainMap.has(cur)) {
|
||||
const subD = getSubdomain(cur, looseTldtsOpt);
|
||||
subdomainMap.set(cur, subD ?? cur);
|
||||
}
|
||||
}
|
||||
|
||||
const sorter = (a: string, b: string) => {
|
||||
if (a === b) return 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user