Skip to content

Commit 3cd75ab

Browse files
committed
perf(integrations): one lookup table for the file-client rows (react-doctor)
1 parent 3080d63 commit 3cd75ab

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎gui/src/pages/integrations/overview-clients.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,8 @@ function fileRow(status: IntegrationStatus): OverviewRow {
357357
export function buildOverviewRows(sources: OverviewSources): OverviewRow[] {
358358
const nativeClaude = sources.native?.find(status => status.clientId === "claude");
359359
const nativeGrok = sources.native?.find(status => status.clientId === "grok");
360+
// One lookup table, not a find per client (react-doctor js-index-maps).
361+
const statusByClient = new Map(sources.clients.map(status => [status.clientId, status]));
360362
const rows: OverviewRow[] = [
361363
codexRow(sources.codex),
362364
keysRow(sources.keyCount),
@@ -365,7 +367,7 @@ export function buildOverviewRows(sources: OverviewSources): OverviewRow[] {
365367
grokRow(sources.grok, nativeGrok, sources.nativeSettled),
366368
];
367369
for (const clientId of FILE_INTEGRATION_CLIENTS) {
368-
const status = sources.clients.find(candidate => candidate.clientId === clientId);
370+
const status = statusByClient.get(clientId);
369371
if (status) {
370372
rows.push(fileRow(status));
371373
continue;

0 commit comments

Comments
 (0)