mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Perf: avoid mutate string in ruleset base
This commit is contained in:
@@ -1,6 +1,15 @@
|
||||
import { createTrie } from './trie';
|
||||
import { describe, it } from 'mocha';
|
||||
import { expect } from 'expect';
|
||||
import { HostnameSmolTrie, HostnameTrie } from './trie';
|
||||
|
||||
function createTrie<Meta = any>(from: string[] | Set<string> | null, smolTree: true): HostnameSmolTrie<Meta>;
|
||||
function createTrie<Meta = any>(from?: string[] | Set<string> | null, smolTree?: false): HostnameTrie<Meta>;
|
||||
function createTrie<_Meta = any>(from?: string[] | Set<string> | null, smolTree = true) {
|
||||
if (smolTree) {
|
||||
return new HostnameSmolTrie(from);
|
||||
}
|
||||
return new HostnameTrie(from);
|
||||
};
|
||||
|
||||
// describe('hostname to tokens', () => {
|
||||
// it('should split hostname into tokens.', () => {
|
||||
|
||||
Reference in New Issue
Block a user