Perf: make reject ruleset dedupe faster

This commit is contained in:
SukkaW 2022-11-02 00:47:24 +08:00
parent 43824facb5
commit 2c1dcd200d

View File

@ -281,16 +281,16 @@ const threads = isCI ? cpuCount : cpuCount / 2;
for (const domain of domainSets) {
let isTobeRemoved = false;
for (const keyword of domainKeywordsSet) {
if (domain.includes(keyword)) {
for (const suffix of domainSuffixSet) {
if (domain.endsWith(suffix)) {
isTobeRemoved = true;
break;
}
}
if (!isTobeRemoved) {
for (const suffix of domainSuffixSet) {
if (domain.endsWith(suffix)) {
for (const keyword of domainKeywordsSet) {
if (domain.includes(keyword)) {
isTobeRemoved = true;
break;
}