Skip to content

Commit 6247d52

Browse files
committed
perf: optimize revalidation loop by using for...of instead of forEach
1 parent 98b84dc commit 6247d52

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/revalidator-manager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ export function revalidateAll(
6464
const flagIndex = type === 'focus' ? 5 : 6;
6565
const now = timeNow();
6666

67-
revalidators.forEach((entry) => {
67+
for (const entry of revalidators.values()) {
6868
if (!entry[flagIndex]) {
69-
return;
69+
continue;
7070
}
7171

7272
entry[1] = now;
@@ -77,7 +77,7 @@ export function revalidateAll(
7777
if (revalidator) {
7878
Promise.resolve(revalidator(isStaleRevalidation)).catch(noop);
7979
}
80-
});
80+
}
8181
}
8282

8383
/**

0 commit comments

Comments
 (0)