From 5e5704b23c00e204e4ab0fc1ba5cf707cfa43edb Mon Sep 17 00:00:00 2001 From: Phil Pluckthun Date: Mon, 19 Oct 2026 15:51:32 +0100 Subject: [PATCH] Bail early on Cache.set when possible --- packages/metro-cache/src/Cache.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/metro-cache/src/Cache.js b/packages/metro-cache/src/Cache.js index 25db66a74c..b68fc9d7ca 100644 --- a/packages/metro-cache/src/Cache.js +++ b/packages/metro-cache/src/Cache.js @@ -85,6 +85,10 @@ export default class Cache { const stores = this.#stores; const stop = this.#hits.get(key); const length = stores.length; + if (length === 0 || stores[0] === stop) { + return; + } + const promises = []; const writeErrors = []; const storesWithErrors = new Set();