From 6aeb5def04ff2db4b2d4172573a8aa8a1d561e9d Mon Sep 17 00:00:00 2001 From: SukkaW Date: Wed, 14 Jun 2023 23:22:17 +0800 Subject: [PATCH] Perf: make dedupe faster --- Build/worker/build-reject-domainset-worker.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Build/worker/build-reject-domainset-worker.js b/Build/worker/build-reject-domainset-worker.js index d4972cd3..bb9d761d 100644 --- a/Build/worker/build-reject-domainset-worker.js +++ b/Build/worker/build-reject-domainset-worker.js @@ -1,7 +1,7 @@ // @ts-check const Piscina = require('piscina'); // const { isCI } = require('ci-info'); - +/** @type {string[]} */ const fullsetDomainStartsWithADot = Piscina.workerData const totalLen = fullsetDomainStartsWithADot.length; @@ -35,7 +35,7 @@ module.exports = ({ chunk }) => { } else { break; } - } else if (domainFromInputChunk.endsWith(domainStartsWithADotAndFromFullSet)) { + } else if (domainFromInputLen > domainFromFullSetLen && domainFromInputChunk.endsWith(domainStartsWithADotAndFromFullSet)) { outputToBeRemoved[i] = 1; // log(domainFromInputChunk, domainStartsWithADotAndFromFullSet) break;