mirror of
https://gitlab.com/SukkaW/ruleset.skk.moe.git
synced 2026-04-20 02:44:25 +00:00
deploy: 6dafa2a4ae058d494e22596f53083e921604450a
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user