[Fiber] Don't bind retry listener if it's in the cache (#34183)

This did an unnecessary bind allocation even if there's cache hit.
This commit is contained in:
Sebastian Markbåge 2025-08-12 21:42:24 -04:00 committed by GitHub
parent 9baecbf02b
commit f1222f7652
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1894,7 +1894,6 @@ function attachSuspenseRetryListeners(
const retryCache = getRetryCache(finishedWork);
wakeables.forEach(wakeable => {
// Memoize using the boundary fiber to prevent redundant listeners.
const retry = resolveRetryWakeable.bind(null, finishedWork, wakeable);
if (!retryCache.has(wakeable)) {
retryCache.add(wakeable);
@ -1911,6 +1910,7 @@ function attachSuspenseRetryListeners(
}
}
const retry = resolveRetryWakeable.bind(null, finishedWork, wakeable);
wakeable.then(retry, retry);
}
});