mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Perf: improve performance of reject suffix/keyword deduping
This commit is contained in:
@@ -77,7 +77,7 @@ const createKeywordFilter = (keys: string[] | Set<string>) => {
|
||||
|
||||
build();
|
||||
|
||||
const search = (text: string) => {
|
||||
return (text: string) => {
|
||||
let node: Node | undefined = root;
|
||||
|
||||
for (let i = 0, textLen = text.length; i < textLen; i++) {
|
||||
@@ -96,10 +96,6 @@ const createKeywordFilter = (keys: string[] | Set<string>) => {
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
return {
|
||||
search
|
||||
};
|
||||
};
|
||||
|
||||
export default createKeywordFilter;
|
||||
|
||||
Reference in New Issue
Block a user