Skip to content

Commit 56efab3

Browse files
authored
Bail early on Cache.set when there’s nothing to do (#2081)
1 parent 91b8161 commit 56efab3

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎packages/metro-cache/src/Cache.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ export default class Cache<T> {
8585
const stores = this.#stores;
8686
const stop = this.#hits.get(key);
8787
const length = stores.length;
88+
if (length === 0 || stores[0] === stop) {
89+
return;
90+
}
91+
8892
const promises = [];
8993
const writeErrors = [];
9094
const storesWithErrors = new Set<string>();

0 commit comments

Comments
 (0)