Skip to content

Commit 04e68eb

Browse files
authored
Merge pull request #51 from PatrickSys/perf/impact-targetset-loop
perf(impact): avoid per-candidate array allocation
2 parents f296e30 + faf6e73 commit 04e68eb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/tools/search-codebase.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,9 @@ export async function handle(
369369
const candidates = new Map<string, ImpactCandidate>();
370370

371371
const addCandidate = (file: string, hop: 1 | 2, line?: number): void => {
372-
if (Array.from(targetSet).some((t) => pathsMatch(t, file))) return;
372+
for (const t of targetSet) {
373+
if (pathsMatch(t, file)) return;
374+
}
373375

374376
const existing = candidates.get(file);
375377
if (existing) {

0 commit comments

Comments
 (0)