mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 09:10:35 +08:00
Perf: avoid extra Map#get in trie.add loop
This commit is contained in:
parent
6e9652e32a
commit
8c23e7919a
@ -85,9 +85,9 @@ export const createTrie = (from?: string[] | Set<string> | null, hostnameMode =
|
||||
if (node.has(token)) {
|
||||
node = node.get(token)!;
|
||||
|
||||
// During the adding of `[start]blog.skk.moe` and find out that there is a `[start].skk.moe` in the trie
|
||||
// During the adding of `[start]blog|.skk.moe` and find out that there is a `[start].skk.moe` in the trie
|
||||
// Dedupe the covered subdomain by skipping
|
||||
if (smolTree && hostnameMode && (node.get('.')?.[SENTINEL])) {
|
||||
if (smolTree && token === '.' && node[SENTINEL]) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user