Skip to content

Commit 411ce28

Browse files
yamadashyclaude
andcommitted
refactor(metrics): Use batchResults.flat() instead of manual loop
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1c6b5a8 commit 411ce28

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/core/metrics/calculateSelectiveFileMetrics.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ export const calculateSelectiveFileMetrics = async (
3939
logger.trace(`Split ${filesToProcess.length} files into ${batches.length} batches for token counting`);
4040

4141
let completedItems = 0;
42-
const allResults: FileMetrics[] = [];
4342

4443
const batchResults = await Promise.all(
4544
batches.map(async (batch) => {
@@ -65,9 +64,7 @@ export const calculateSelectiveFileMetrics = async (
6564
}),
6665
);
6766

68-
for (const batchResult of batchResults) {
69-
allResults.push(...batchResult);
70-
}
67+
const allResults = batchResults.flat();
7168

7269
const endTime = process.hrtime.bigint();
7370
const duration = Number(endTime - startTime) / 1e6;

0 commit comments

Comments
 (0)