From 8792bb9c0bd435d76b4bca56fbc1c0a6d9d9d7a9 Mon Sep 17 00:00:00 2001 From: voommen-livefront Date: Wed, 5 Nov 2025 15:02:34 -0600 Subject: [PATCH] PM-27739 optimization recommended by claude applied --- .../all-applications/all-applications.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/all-applications/all-applications.component.ts b/bitwarden_license/bit-web/src/app/dirt/access-intelligence/all-applications/all-applications.component.ts index 919fbf1ac9b..7d9c7704d67 100644 --- a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/all-applications/all-applications.component.ts +++ b/bitwarden_license/bit-web/src/app/dirt/access-intelligence/all-applications/all-applications.component.ts @@ -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),