mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 01:00:34 +08:00
Disable Wildcard Dedupe
This commit is contained in:
parent
bc747a22ae
commit
5807e07608
@ -21,7 +21,7 @@ export class FileOutput {
|
||||
protected dataSource = new Set<string>();
|
||||
|
||||
public domainTrie = new HostnameSmolTrie(null);
|
||||
public wildcardTrie: HostnameSmolTrie = new HostnameSmolTrie(null);
|
||||
public wildcardSet = new Set<string>();
|
||||
|
||||
protected domainKeywords = new Set<string>();
|
||||
|
||||
@ -51,7 +51,6 @@ export class FileOutput {
|
||||
|
||||
whitelistDomain = (domain: string) => {
|
||||
this.domainTrie.whitelist(domain);
|
||||
this.wildcardTrie.whitelist(domain);
|
||||
return this;
|
||||
};
|
||||
|
||||
@ -150,7 +149,7 @@ export class FileOutput {
|
||||
|
||||
bulkAddDomainWildcard(domains: string[]) {
|
||||
for (let i = 0, len = domains.length; i < len; i++) {
|
||||
this.wildcardTrie.add(domains[i]);
|
||||
this.wildcardSet.add(domains[i]);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
@ -216,7 +215,7 @@ export class FileOutput {
|
||||
this.addDomainKeyword(value);
|
||||
break;
|
||||
case 'DOMAIN-WILDCARD':
|
||||
this.wildcardTrie.add(value);
|
||||
this.wildcardSet.add(value);
|
||||
break;
|
||||
case 'USER-AGENT':
|
||||
this.userAgent.add(value);
|
||||
@ -418,8 +417,6 @@ export class FileOutput {
|
||||
return;
|
||||
}
|
||||
|
||||
this.wildcardTrie.whitelist(domain, includeAllSubdomain);
|
||||
|
||||
for (let i = 0; i < strategiesLen; i++) {
|
||||
const strategy = this.strategies[i];
|
||||
if (includeAllSubdomain) {
|
||||
@ -445,16 +442,14 @@ export class FileOutput {
|
||||
}
|
||||
}
|
||||
|
||||
this.wildcardTrie.dumpWithoutDot((wildcard) => {
|
||||
if (kwfilter(wildcard)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (let i = 0; i < strategiesLen; i++) {
|
||||
const strategy = this.strategies[i];
|
||||
strategy.writeDomainWildcard(wildcard);
|
||||
}
|
||||
}, true);
|
||||
if (this.wildcardSet.size) {
|
||||
this.wildcardSet.forEach((wildcard) => {
|
||||
for (let i = 0; i < strategiesLen; i++) {
|
||||
const strategy = this.strategies[i];
|
||||
strategy.writeDomainWildcard(wildcard);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const sourceIpOrCidr = Array.from(this.sourceIpOrCidr);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user