Skip to content

Commit 6a972b3

Browse files
authored
perf: remove return statements lookback in component collector to improve performance (#1129)
1 parent bf27bf4 commit 6a972b3

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

packages/core/src/component/component-collector.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,6 @@ export function useComponentCollector(
6767
const entry = functionEntries.at(-1);
6868
if (entry == null) return;
6969
if (!entry.isComponent) return functionEntries.pop();
70-
const shouldDrop = AST.getNestedReturnStatements(entry.node.body)
71-
.slice()
72-
.reverse()
73-
.some((r) => {
74-
return context.sourceCode.getScope(r).block === entry.node
75-
&& r.argument != null
76-
&& !isJsxLike(context.sourceCode, r.argument, hint);
77-
});
78-
if (shouldDrop) {
79-
components.delete(entry.key);
80-
}
8170
return functionEntries.pop();
8271
};
8372

0 commit comments

Comments
 (0)