From e6c7ab5425c6836250d478f77b12b9ae1403b245 Mon Sep 17 00:00:00 2001 From: calixteman Date: Sun, 19 Jul 2026 16:42:05 +0200 Subject: [PATCH] Skip the cache existence check when --no-download is set Move the `fs.existsSync(indexPath)` check below the `--no-download` early return: in that mode the check is unused (the read after refreshIndex already validates existence), so it's wasted disk I/O. --- external/ccov/coverage_search.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/external/ccov/coverage_search.mjs b/external/ccov/coverage_search.mjs index ed3519e81..e4f4536ec 100644 --- a/external/ccov/coverage_search.mjs +++ b/external/ccov/coverage_search.mjs @@ -89,12 +89,12 @@ const etagPath = `${indexPath}.etag`; // only when it has changed since the last run. When the network is unavailable // a previously cached copy is reused if present. async function refreshIndex() { - const hasCached = fs.existsSync(indexPath); - if (values["no-download"]) { return; // Freshness check disabled; the read below validates existence. } + const hasCached = fs.existsSync(indexPath); + // On any download failure, fall back to a previously cached copy when one // exists; otherwise there's nothing to search, so fail. const fallbackOrFail = reason => {