From 5fc0c136a26dec5aa6b670a4448d8395e5e7830e Mon Sep 17 00:00:00 2001 From: anyulled <100741+anyulled@users.noreply.github.com> Date: Mon, 4 May 2026 08:13:49 +0000 Subject: [PATCH 1/3] =?UTF-8?q?=E2=9A=A1=20Bolt:=20Optimize=20schedule=20f?= =?UTF-8?q?iltering=20to=20use=20Set?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Converted the `savedSessionIds` array into a `Set` prior to running the `Array.filter()` method in `ScheduleContainer.tsx`. This changes the time complexity from O(N*M) to O(N+M) when looking up saved sessions. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> --- components/schedule/ScheduleContainer.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/schedule/ScheduleContainer.tsx b/components/schedule/ScheduleContainer.tsx index 33d877a4..83f41b4d 100644 --- a/components/schedule/ScheduleContainer.tsx +++ b/components/schedule/ScheduleContainer.tsx @@ -20,7 +20,10 @@ export default function ScheduleContainer({ initialSchedule, year }: Readonly sessions.filter((s) => savedSessionIds.includes(s.id) || s.isServiceSession); + // ⚡ Bolt: Convert array to Set to reduce time complexity from O(N*M) to O(N+M) during filtering + const savedSessionIdsSet = new Set(savedSessionIds); + + const filterSessions = (sessions: GridSession[]) => sessions.filter((s) => savedSessionIdsSet.has(s.id) || s.isServiceSession); return initialSchedule.map((day) => ({ ...day, From 8960c1e319776bf3e22d695549991717a433c5c8 Mon Sep 17 00:00:00 2001 From: Anyul Rivas Date: Mon, 4 May 2026 19:26:39 +0200 Subject: [PATCH 2/3] Update components/schedule/ScheduleContainer.tsx Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- components/schedule/ScheduleContainer.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/schedule/ScheduleContainer.tsx b/components/schedule/ScheduleContainer.tsx index 83f41b4d..6aa01af5 100644 --- a/components/schedule/ScheduleContainer.tsx +++ b/components/schedule/ScheduleContainer.tsx @@ -20,8 +20,7 @@ export default function ScheduleContainer({ initialSchedule, year }: Readonly sessions.filter((s) => savedSessionIdsSet.has(s.id) || s.isServiceSession); From de74f830e37629c9f3dcce7c321fe38848419b90 Mon Sep 17 00:00:00 2001 From: anyulled <100741+anyulled@users.noreply.github.com> Date: Mon, 4 May 2026 17:42:18 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=E2=9A=A1=20Bolt:=20Optimize=20schedule=20f?= =?UTF-8?q?iltering=20to=20use=20Set?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Converted the `savedSessionIds` array into a `Set` prior to running the `Array.filter()` method in `ScheduleContainer.tsx`. This changes the time complexity from O(N*M) to O(N+M) when looking up saved sessions. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> --- components/schedule/ScheduleContainer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/schedule/ScheduleContainer.tsx b/components/schedule/ScheduleContainer.tsx index 6aa01af5..f6453839 100644 --- a/components/schedule/ScheduleContainer.tsx +++ b/components/schedule/ScheduleContainer.tsx @@ -20,7 +20,7 @@ export default function ScheduleContainer({ initialSchedule, year }: Readonly sessions.filter((s) => savedSessionIdsSet.has(s.id) || s.isServiceSession);