Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,11 @@ jobs:
return 'skip';
}
function latestIso(values) {
const times = values
.map(value => Date.parse(value))
.filter(Number.isFinite);
return times.length > 0
? new Date(Math.max(...times)).toISOString()
: null;
const maxTime = values.reduce((max, val) => {
const time = Date.parse(val);
return Number.isFinite(time) && time > max ? time : max;
}, -Infinity);
return maxTime > -Infinity ? new Date(maxTime).toISOString() : null;
}
function workflowRunId(targetUrl) {
const target = String(targetUrl || '');
Expand Down
2 changes: 1 addition & 1 deletion .jules/bolt.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
**Action:** Extract pure transformation logic on static/infrequent data into `useMemo` hooks (e.g., memoizing the paragraph split on `transcript` and precomputing search `RegExp` based on `searchQuery`).
## 2026-07-24 - Avoiding spread operator for large arrays in calculations
**Learning:** Using `Math.max(...array.map())` on potentially large data structures runs the risk of hitting the "Maximum call stack size exceeded" error, and creates unnecessary intermediate array allocations, reducing performance.
**Action:** Replace multiple O(N) array mapping and spread operations with a single O(N) `for` loop to compute bounds simultaneously with zero intermediate allocations.
**Action:** Replace multiple O(N) array mapping and spread operations with a single O(N) `for` loop to compute bounds simultaneously with zero intermediate allocations. Or in cases finding the max of parsed strings, use a `.reduce()` loop for a safe single pass without generating intermediate array structures.
Loading