Update Reject Filter Parsing

This commit is contained in:
SukkaW
2022-12-26 00:12:59 +08:00
parent 14494a0919
commit 44aeb217d8
8 changed files with 366 additions and 92 deletions

View File

@@ -1,8 +1,11 @@
const Piscina = require('piscina');
const { isCI } = require('ci-info');
const fullsetDomainStartsWithADot = Piscina.workerData
const totalLen = fullsetDomainStartsWithADot.length;
const log = isCI ? () => { } : console.log.bind(console);
module.exports.dedupe = ({ chunk }) => {
const chunkLength = chunk.length;
const outputToBeRemoved = new Int8Array(chunkLength);
@@ -34,6 +37,7 @@ module.exports.dedupe = ({ chunk }) => {
if (shouldBeRemoved) {
outputToBeRemoved[i] = 1;
log(domainFromInput, domainFromFullSet)
break;
}
}
@@ -42,6 +46,7 @@ module.exports.dedupe = ({ chunk }) => {
// domainFromInput is now startsWith a "."
if (domainFromInput.endsWith(domainFromFullSet)) {
outputToBeRemoved[i] = 1;
log(domainFromInput, domainFromFullSet)
break;
}
}