Skip to content

Commit 4a98355

Browse files
committed
perf
1 parent 2cc52bd commit 4a98355

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/language-core/lib/parsers/scriptSetupRanges.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,10 @@ export function parseScriptSetupRanges(
102102
});
103103
ts.forEachChild(ast, child => visitNode(child, [ast]));
104104

105+
const templateRefNames = new Set(templateRefs.map(ref => ref.name));
105106
bindings = bindings.filter(range => {
106-
const name = ast.text.substring(range.start, range.end);
107-
return templateRefs.every(ref => ref.name !== name);
107+
const name = text.substring(range.start, range.end);
108+
return !templateRefNames.has(name);
108109
});
109110

110111
return {

0 commit comments

Comments
 (0)