deploy: 6dafa2a4ae058d494e22596f53083e921604450a

This commit is contained in:
SukkaBot
2022-09-23 00:33:48 +00:00
parent 48f6f6edc9
commit aeb2f9f000
3 changed files with 41 additions and 18 deletions

View File

@@ -1,16 +1,16 @@
const { workerData, move } = require('piscina');
// pre check if fullset domain is starts with a "."
// This avoid calling chatCodeAt repeatedly
// workerData is an array of string. Sort it by length, short first:
const fullsetDomainStartsWithADot = workerData.filter(domain => (
domain.charCodeAt(0) === 46
&& !canExcludeFromDedupe(domain)
));
const totalLen = fullsetDomainStartsWithADot.length;
module.exports = ({ chunk }) => {
// pre check if fullset domain is starts with a "."
// This avoid calling chatCodeAt repeatedly
// workerData is an array of string. Sort it by length, short first:
const fullsetDomainStartsWithADot = workerData.filter(domain => (
domain.charCodeAt(0) === 46
&& !canExcludeFromDedupe(domain)
));
const totalLen = fullsetDomainStartsWithADot.length;
const chunkLength = chunk.length;
const outputToBeRemoved = new Int8Array(chunkLength);
@@ -65,7 +65,7 @@ module.exports = ({ chunk }) => {
};
// duckdns.org domain will not overlap and doesn't need dedupe
function canExcludeFromDedupe(domain) {
function canExcludeFromDedupe (domain) {
if (domain.length === 23 && domain.endsWith('.duckdns.org')) {
return true;
}