mirror of
https://github.com/bitwarden/browser
synced 2026-02-04 18:53:20 +00:00
PM-27739 optimization recommended by claude applied
This commit is contained in:
@@ -84,10 +84,14 @@ export class AllApplicationsComponent implements OnInit {
|
||||
}
|
||||
|
||||
// Map ciphers to each application
|
||||
const cipherMap = new Map(ciphers.map((c) => [c.id, c]));
|
||||
const reportWithCiphers = report.reportData.map((app) => ({
|
||||
...app,
|
||||
ciphers: ciphers?.filter((cipher) => app.cipherIds.includes(cipher.id)) ?? [],
|
||||
ciphers: app.cipherIds
|
||||
.map((id) => cipherMap.get(id))
|
||||
.filter((c): c is CipherView => c !== undefined),
|
||||
}));
|
||||
|
||||
return of({ ...report, reportData: reportWithCiphers });
|
||||
}),
|
||||
takeUntilDestroyed(this.destroyRef),
|
||||
|
||||
Reference in New Issue
Block a user