mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Update Reject Filter Parsing
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user