Perf: faster is-domain-loose check

This commit is contained in:
SukkaW
2022-11-07 18:53:32 +08:00
parent 016eb1088a
commit 4565b15e17
4 changed files with 66 additions and 25 deletions

View File

@@ -45,7 +45,10 @@ const filterRuleWhitelistDomainSets = new Set(PREDEFINED_WHITELIST);
if (Array.isArray(input) && input.length === 2) {
return processFilterRules(input[0], input[1]);
}
}))).forEach(({ white, black }) => {
}))).forEach(({ white, black, foundDebugDomain }) => {
if (foundDebugDomain) {
process.exit(1);
};
white.forEach(i => filterRuleWhitelistDomainSets.add(i));
black.forEach(i => domainSets.add(i));
});