mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-28 17:41:54 +08:00
Perf: minor optimization here and there
This commit is contained in:
@@ -32,7 +32,10 @@ export const getMicrosoftCdnRulesetPromise = createMemoizedPromise(async () => {
|
||||
});
|
||||
|
||||
const trie2 = createTrie(set);
|
||||
BLACKLIST.flatMap(domain => trie2.find(domain, true)).forEach(d => set.delete(d));
|
||||
const black = BLACKLIST.flatMap(domain => trie2.find(domain, true));
|
||||
for (let i = 0, len = black.length; i < len; i++) {
|
||||
set.delete(black[i]);
|
||||
}
|
||||
|
||||
return Array.from(set).map(d => `DOMAIN-SUFFIX,${d}`).concat(WHITELIST);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user