Skip to content

Commit a98b624

Browse files
perf(client): avoid temporary arrays in inbox snapshots (#27467)
1 parent db7db4d commit a98b624

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎packages/client-runtime/src/state/threadInbox.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ export function createInboxReturnTracker() {
227227
}
228228
}
229229
schedule();
230-
const observedWorking = new Map([...states].map(([key, state]) => [key, state.working]));
230+
const observedWorking = new Map<string, boolean>();
231+
states.forEach((state, key) => observedWorking.set(key, state.working));
231232
const observedReturns = new Map(returns);
232233
return {
233234
isWorking: (thread) => observedWorking.get(keyOf(thread)) ?? isThreadWorking(thread),

0 commit comments

Comments
 (0)