Skip to content

Commit 4089676

Browse files
tryouts 1
1 parent c167edd commit 4089676

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/OnyxCache.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,12 @@ class OnyxCache {
356356
* Finds a key that can be safely evicted
357357
*/
358358
getKeyForEviction(): OnyxKey | undefined {
359-
return this.recentlyAccessedKeys.find((key) => !this.evictionBlocklist[key]);
359+
for (const key of this.recentlyAccessedKeys) {
360+
if (!this.evictionBlocklist[key]) {
361+
return key;
362+
}
363+
}
364+
return undefined;
360365
}
361366
}
362367

0 commit comments

Comments
 (0)