Browse Source

Perf: make reject ruleset dedupe faster

SukkaW 3 years ago
parent
commit
2c1dcd200d
1 changed files with 4 additions and 4 deletions
  1. 4 4
      Build/build-reject-domainset.js

+ 4 - 4
Build/build-reject-domainset.js

@@ -281,16 +281,16 @@ const threads = isCI ? cpuCount : cpuCount / 2;
   for (const domain of domainSets) {
     let isTobeRemoved = false;
 
-    for (const keyword of domainKeywordsSet) {
-      if (domain.includes(keyword)) {
+    for (const suffix of domainSuffixSet) {
+      if (domain.endsWith(suffix)) {
         isTobeRemoved = true;
         break;
       }
     }
 
     if (!isTobeRemoved) {
-      for (const suffix of domainSuffixSet) {
-        if (domain.endsWith(suffix)) {
+      for (const keyword of domainKeywordsSet) {
+        if (domain.includes(keyword)) {
           isTobeRemoved = true;
           break;
         }